Struct wnf::StampedData
source · pub struct StampedData<T> { /* private fields */ }
Expand description
State data together with a change stamp
Implementations§
source§impl<T> StampedData<T>
impl<T> StampedData<T>
sourcepub fn from_data_change_stamp(
data: T,
change_stamp: impl Into<ChangeStamp>
) -> Self
pub fn from_data_change_stamp( data: T, change_stamp: impl Into<ChangeStamp> ) -> Self
Creates a new StampedData
from the given data and change stamp
sourcepub fn into_data_change_stamp(self) -> (T, ChangeStamp)
pub fn into_data_change_stamp(self) -> (T, ChangeStamp)
Moves the contained data and change stamp out of this StampedData
sourcepub fn into_data(self) -> T
pub fn into_data(self) -> T
Moves the contained data out of this StampedData
, discarding the change stamp
sourcepub const fn data(&self) -> &T
pub const fn data(&self) -> &T
Returns a reference to the data contained in this StampedData
sourcepub const fn change_stamp(&self) -> ChangeStamp
pub const fn change_stamp(&self) -> ChangeStamp
Returns the change stamp contained in this StampedData
sourcepub fn map<U, F>(self, op: F) -> StampedData<U>where
F: FnOnce(T) -> U,
pub fn map<U, F>(self, op: F) -> StampedData<U>where
F: FnOnce(T) -> U,
Returns a new StampedData
obtained by applying a given closure to the contained data
Trait Implementations§
source§impl<T> AsMut<T> for StampedData<T>
impl<T> AsMut<T> for StampedData<T>
source§impl<T> AsRef<T> for StampedData<T>
impl<T> AsRef<T> for StampedData<T>
source§impl<T: Clone> Clone for StampedData<T>
impl<T: Clone> Clone for StampedData<T>
source§fn clone(&self) -> StampedData<T>
fn clone(&self) -> StampedData<T>
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<T: Debug> Debug for StampedData<T>
impl<T: Debug> Debug for StampedData<T>
source§impl<T: Default> Default for StampedData<T>
impl<T: Default> Default for StampedData<T>
source§fn default() -> StampedData<T>
fn default() -> StampedData<T>
Returns the “default value” for a type. Read more
source§impl<T> From<(T, ChangeStamp)> for StampedData<T>
impl<T> From<(T, ChangeStamp)> for StampedData<T>
source§fn from((data, change_stamp): (T, ChangeStamp)) -> Self
fn from((data, change_stamp): (T, ChangeStamp)) -> Self
Converts to this type from the input type.
source§impl<T> From<StampedData<T>> for (T, ChangeStamp)
impl<T> From<StampedData<T>> for (T, ChangeStamp)
source§fn from(stamped_data: StampedData<T>) -> Self
fn from(stamped_data: StampedData<T>) -> Self
Converts to this type from the input type.
source§impl<T: Hash> Hash for StampedData<T>
impl<T: Hash> Hash for StampedData<T>
source§impl<T: PartialEq> PartialEq for StampedData<T>
impl<T: PartialEq> PartialEq for StampedData<T>
source§fn eq(&self, other: &StampedData<T>) -> bool
fn eq(&self, other: &StampedData<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Copy> Copy for StampedData<T>
impl<T: Eq> Eq for StampedData<T>
impl<T> StructuralPartialEq for StampedData<T>
Auto Trait Implementations§
impl<T> Freeze for StampedData<T>where
T: Freeze,
impl<T> RefUnwindSafe for StampedData<T>where
T: RefUnwindSafe,
impl<T> Send for StampedData<T>where
T: Send,
impl<T> Sync for StampedData<T>where
T: Sync,
impl<T> Unpin for StampedData<T>where
T: Unpin,
impl<T> UnwindSafe for StampedData<T>where
T: UnwindSafe,
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