pub struct Metadata<'a> { /* private fields */ }
Expand description
A reference to the metadata inside of a MetadataLog.
Implementations§
Source§impl<'a> Metadata<'a>
impl<'a> Metadata<'a>
Sourcepub fn is_latest(&self) -> bool
pub fn is_latest(&self) -> bool
Returns true
if the current metadata revision is the newest, false
otherwise.
Sourcepub fn current(&self) -> Option<&MetadataRevision>
pub fn current(&self) -> Option<&MetadataRevision>
Gets an immutable reference to the current, and therefore oldest, revision of the metadata.
Sourcepub fn skip_to_latest(&mut self) -> Option<&MetadataRevision>
pub fn skip_to_latest(&mut self) -> Option<&MetadataRevision>
Skips to, and gets an immutable reference to the latest, and therefore newest, revision of the metadata.
Sourcepub fn pop(&mut self) -> Option<MetadataRevision>
pub fn pop(&mut self) -> Option<MetadataRevision>
If there are newer Metadata
revisions, advances the MetadataLog
by discarding the
current revision and replacing it with the next revision, returning the discarded
Metadata
. When there are no newer revisions, None
is returned. As such, pop
will never
completely empty the log.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Metadata<'a>
impl<'a> RefUnwindSafe for Metadata<'a>
impl<'a> Send for Metadata<'a>
impl<'a> Sync for Metadata<'a>
impl<'a> Unpin for Metadata<'a>
impl<'a> !UnwindSafe for Metadata<'a>
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