pub struct Epoch<T = u128> { /* private fields */ }
Implementations§
Source§impl<T> Epoch<T>
impl<T> Epoch<T>
pub fn new(size: u128, timestamp: Timestamp<T>) -> 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) -> &T
pub fn set_size(&mut self, size: u128)
Trait Implementations§
Source§impl<T: Ord> Ord for Epoch<T>
impl<T: Ord> Ord for Epoch<T>
Source§impl<T: PartialOrd> PartialOrd for Epoch<T>
impl<T: PartialOrd> PartialOrd for Epoch<T>
impl<T: Copy> Copy for Epoch<T>
impl<T: Eq> Eq for Epoch<T>
impl<T> StructuralPartialEq for Epoch<T>
Auto Trait Implementations§
impl<T> Freeze for Epoch<T>where
T: Freeze,
impl<T> RefUnwindSafe for Epoch<T>where
T: RefUnwindSafe,
impl<T> Send for Epoch<T>where
T: Send,
impl<T> Sync for Epoch<T>where
T: Sync,
impl<T> Unpin for Epoch<T>where
T: Unpin,
impl<T> UnwindSafe for Epoch<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