pub struct Epoch<Ts = u128>where
Ts: RawTimestamp,{ /* private fields */ }
Implementations§
Source§impl<Ts> Epoch<Ts>where
Ts: RawTimestamp,
impl<Ts> Epoch<Ts>where
Ts: RawTimestamp,
pub fn new(size: u128, timestamp: Timestamp<Ts>) -> Self
Sourcepub fn size(&self) -> u128
pub fn size(&self) -> u128
The size of the epoch; epochs generally consider the number of steps, or size, (e.g. the number of seconds) that will need to be taken before the epoch is considered to be complete and a new one begins.
pub fn timestamp(&self) -> &Ts
pub fn set_size(&mut self, size: u128)
Trait Implementations§
Source§impl<'de, Ts> Deserialize<'de> for Epoch<Ts>where
Ts: RawTimestamp + Deserialize<'de>,
impl<'de, Ts> Deserialize<'de> for Epoch<Ts>where
Ts: RawTimestamp + Deserialize<'de>,
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<Ts> Ord for Epoch<Ts>where
Ts: RawTimestamp + Ord,
impl<Ts> Ord for Epoch<Ts>where
Ts: RawTimestamp + Ord,
Source§impl<Ts> PartialOrd for Epoch<Ts>where
Ts: RawTimestamp + PartialOrd,
impl<Ts> PartialOrd for Epoch<Ts>where
Ts: RawTimestamp + PartialOrd,
impl<Ts> Copy for Epoch<Ts>where
Ts: RawTimestamp + Copy,
impl<Ts> Eq for Epoch<Ts>where
Ts: RawTimestamp + Eq,
impl<Ts> StructuralPartialEq for Epoch<Ts>where
Ts: RawTimestamp,
Auto Trait Implementations§
impl<Ts> Freeze for Epoch<Ts>where
Ts: Freeze,
impl<Ts> RefUnwindSafe for Epoch<Ts>where
Ts: RefUnwindSafe,
impl<Ts> Send for Epoch<Ts>where
Ts: Send,
impl<Ts> Sync for Epoch<Ts>where
Ts: Sync,
impl<Ts> Unpin for Epoch<Ts>where
Ts: Unpin,
impl<Ts> UnwindSafe for Epoch<Ts>where
Ts: 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