pub struct AuthorHeads { /* private fields */ }
Expand description
Timestamps of the latest entry for each author.
Implementations§
Source§impl AuthorHeads
impl AuthorHeads
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this AuthorHeads
is empty.
Sourcepub fn has_news_for(&self, other: &Self) -> Option<NonZeroU64>
pub fn has_news_for(&self, other: &Self) -> Option<NonZeroU64>
Can this state offer newer stuff to other
?
Sourcepub fn iter(&self) -> Iter<'_, AuthorId, u64>
pub fn iter(&self) -> Iter<'_, AuthorId, u64>
Create an iterator over the entries in this state.
Sourcepub fn encode(&self, size_limit: Option<usize>) -> Result<Vec<u8>>
pub fn encode(&self, size_limit: Option<usize>) -> Result<Vec<u8>>
Encode into a byte array with a limited size.
Will skip oldest entries if the size limit is reached.
Returns a byte array with a maximum length of size_limit
.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self>
pub fn decode(bytes: &[u8]) -> Result<Self>
Decode from byte slice created with Self::encode
.
Trait Implementations§
Source§impl Clone for AuthorHeads
impl Clone for AuthorHeads
Source§fn clone(&self) -> AuthorHeads
fn clone(&self) -> AuthorHeads
Returns a copy 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 AuthorHeads
impl Debug for AuthorHeads
Source§impl Default for AuthorHeads
impl Default for AuthorHeads
Source§fn default() -> AuthorHeads
fn default() -> AuthorHeads
Returns the “default value” for a type. Read more
Source§impl FromIterator<(AuthorId, u64)> for AuthorHeads
impl FromIterator<(AuthorId, u64)> for AuthorHeads
Source§impl FromIterator<(u64, AuthorId)> for AuthorHeads
impl FromIterator<(u64, AuthorId)> for AuthorHeads
Source§impl PartialEq for AuthorHeads
impl PartialEq for AuthorHeads
impl Eq for AuthorHeads
impl StructuralPartialEq for AuthorHeads
Auto Trait Implementations§
impl Freeze for AuthorHeads
impl RefUnwindSafe for AuthorHeads
impl Send for AuthorHeads
impl Sync for AuthorHeads
impl Unpin for AuthorHeads
impl UnwindSafe for AuthorHeads
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
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
Compare self to
key
and return true
if they are equal.§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