pub struct Entry { /* private fields */ }Expand description
A single entry in a Replica
An entry is identified by a key, its Author, and the Replica’s
Namespace. Its value is the 32-byte BLAKE3 hash
of the entry’s content data, the size of this content data, and a timestamp.
Implementations§
source§impl Entry
impl Entry
sourcepub fn new(id: RecordIdentifier, record: Record) -> Self
pub fn new(id: RecordIdentifier, record: Record) -> Self
Create a new entry
sourcepub fn new_empty(id: RecordIdentifier) -> Self
pub fn new_empty(id: RecordIdentifier) -> Self
Create a new empty entry with the current timestamp.
sourcepub fn validate_empty(&self) -> Result<(), ValidationFailure>
pub fn validate_empty(&self) -> Result<(), ValidationFailure>
Validate that the entry has the empty hash if the length is 0, or a non-zero length.
sourcepub fn id(&self) -> &RecordIdentifier
pub fn id(&self) -> &RecordIdentifier
Get the RecordIdentifier for this entry.
sourcepub fn namespace(&self) -> NamespaceId
pub fn namespace(&self) -> NamespaceId
Get the NamespaceId of this entry.
Get the AuthorId of this entry.
sourcepub fn encode(&self, out: &mut Vec<u8>)
pub fn encode(&self, out: &mut Vec<u8>)
Serialize this entry into its canonical byte representation used for signing.
Methods from Deref<Target = Record>§
sourcepub fn content_len(&self) -> u64
pub fn content_len(&self) -> u64
Get the length of the data addressed by this record’s content hash.
sourcepub fn content_hash(&self) -> Hash
pub fn content_hash(&self) -> Hash
Get the Hash of the content data of this record.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Entry
impl<'de> Deserialize<'de> for Entry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<SignedEntry> for Entry
impl From<SignedEntry> for Entry
source§fn from(value: SignedEntry) -> Self
fn from(value: SignedEntry) -> Self
Converts to this type from the input type.
source§impl Ord for Entry
impl Ord for Entry
source§impl PartialEq for Entry
impl PartialEq for Entry
source§impl PartialOrd for Entry
impl PartialOrd for Entry
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for Entry
impl StructuralEq for Entry
impl StructuralPartialEq for Entry
Auto Trait Implementations§
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnwindSafe for Entry
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§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
§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
Compare self to
key and return true if they are equal.