pub struct SlotHeader {
pub device: DeviceId,
pub claim: u64,
pub author: MemberId,
pub after: u64,
}Expand description
The author and claim identity sealed under the store key in every slot.
Fields§
§device: DeviceIdThe claiming device.
claim: u64Positive number from this device’s counter across every slot kind.
The member whose credential signs the slot.
after: u64The immediately preceding slot, zero for creation.
Implementations§
Source§impl SlotHeader
impl SlotHeader
Sourcepub const ENCODED_LEN: usize
pub const ENCODED_LEN: usize
The encoded frame’s length: its prefix, then device, claim, author and predecessor.
Sourcepub fn encode(&self, path: &ObjectPath) -> Result<Vec<u8>, Error>
pub fn encode(&self, path: &ObjectPath) -> Result<Vec<u8>, Error>
Encode the kind-14 frame, checking its path binding.
Sourcepub fn decode(bytes: &[u8], path: &ObjectPath) -> Result<Self, Error>
pub fn decode(bytes: &[u8], path: &ObjectPath) -> Result<Self, Error>
Decode exactly the kind-14 frame and check its path binding.
Sourcepub fn validate_at(&self, path: &ObjectPath) -> Result<(), Error>
pub fn validate_at(&self, path: &ObjectPath) -> Result<(), Error>
A header’s predecessor must be exactly one less than its path’s slot.
Sourcepub fn check_write(&self, write: &WriteHeader) -> Result<(), Error>
pub fn check_write(&self, write: &WriteHeader) -> Result<(), Error>
Check an opened inner write against its containing slot. The consumer resolves its historical signer and its source writes separately.
Trait Implementations§
Source§impl Clone for SlotHeader
impl Clone for SlotHeader
Source§fn clone(&self) -> SlotHeader
fn clone(&self) -> SlotHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SlotHeader
impl Debug for SlotHeader
Source§impl PartialEq for SlotHeader
impl PartialEq for SlotHeader
impl Eq for SlotHeader
impl StructuralPartialEq for SlotHeader
Auto Trait Implementations§
impl Freeze for SlotHeader
impl RefUnwindSafe for SlotHeader
impl Send for SlotHeader
impl Sync for SlotHeader
impl Unpin for SlotHeader
impl UnsafeUnpin for SlotHeader
impl UnwindSafe for SlotHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more