Enum thor::BlockDateGenerator
source · pub enum BlockDateGenerator {
Rolling {
block0_time: SystemTime,
slot_duration: u64,
slots_per_epoch: u32,
shift: BlockDate,
shift_back: bool,
},
Fixed(BlockDate),
}
Variants§
Implementations§
source§impl BlockDateGenerator
impl BlockDateGenerator
pub fn rolling_from_blockchain_config( blockchain_configuration: &BlockchainConfiguration, shift: BlockDate, shift_back: bool ) -> Self
sourcepub fn rolling(
block0_settings: &SettingsDto,
shift: BlockDate,
shift_back: bool
) -> Self
pub fn rolling( block0_settings: &SettingsDto, shift: BlockDate, shift_back: bool ) -> Self
Returns BlockDate
s that are always ahead or behind the current date by a certain shift
sourcepub fn shifted(
block0_settings: &SettingsDto,
shift: BlockDate,
shift_back: bool
) -> Self
pub fn shifted( block0_settings: &SettingsDto, shift: BlockDate, shift_back: bool ) -> Self
Shifts the current date and returns the result on all subsequent calls
pub fn block_date(&self) -> BlockDate
pub fn shift_ahead( slots_per_epoch: u32, date: BlockDate, shift: BlockDate ) -> BlockDate
pub fn shift_back( slots_per_epoch: u32, date: BlockDate, shift: BlockDate ) -> BlockDate
pub fn current_blockchain_age( block0_time: SystemTime, slots_per_epoch: u32, slot_duration: u64 ) -> BlockDate
Trait Implementations§
source§impl Clone for BlockDateGenerator
impl Clone for BlockDateGenerator
source§fn clone(&self) -> BlockDateGenerator
fn clone(&self) -> BlockDateGenerator
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 moreAuto Trait Implementations§
impl RefUnwindSafe for BlockDateGenerator
impl Send for BlockDateGenerator
impl Sync for BlockDateGenerator
impl Unpin for BlockDateGenerator
impl UnwindSafe for BlockDateGenerator
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request