pub struct Poh {
pub hash: Hash,
/* private fields */
}Fields§
§hash: HashImplementations§
Source§impl Poh
impl Poh
pub fn new(hash: Hash, hashes_per_tick: Option<u64>) -> Self
pub fn new_with_slot_info( hash: Hash, hashes_per_tick: Option<u64>, tick_number: u64, ) -> Self
pub fn reset(&mut self, hash: Hash, hashes_per_tick: Option<u64>)
pub fn hashes_per_tick(&self) -> u64
pub fn target_poh_time(&self, target_ns_per_tick: u64) -> Instant
Sourcepub fn hash(&mut self, max_num_hashes: u64) -> bool
pub fn hash(&mut self, max_num_hashes: u64) -> bool
Return true if the caller needs to tick() next, i.e. if the
remaining_hashes is 1.
pub fn record(&mut self, mixin: Hash) -> Option<PohEntry>
Sourcepub fn record_batches(
&mut self,
mixins: &[Hash],
entries: &mut Vec<PohEntry>,
) -> bool
pub fn record_batches( &mut self, mixins: &[Hash], entries: &mut Vec<PohEntry>, ) -> bool
Returns true if the batches were recorded successfully and false if the batches
were not recorded because there were not enough hashes remaining to record all mixins.
If true is returned, the entries vector will be populated with the PohEntrys for each
batch. If false is returned, the entries vector will not be modified.
pub fn tick(&mut self) -> Option<PohEntry>
Auto Trait Implementations§
impl Freeze for Poh
impl RefUnwindSafe for Poh
impl Send for Poh
impl Sync for Poh
impl Unpin for Poh
impl UnwindSafe for Poh
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more