pub struct Tape { /* private fields */ }Expand description
words_per_tick may be zero.
Implementations§
Source§impl Tape
impl Tape
pub fn new(tick_hz: u32, seed: u64, words_per_tick: u32) -> Self
pub fn tick_hz(&self) -> u32
pub fn seed(&self) -> u64
pub fn words_per_tick(&self) -> u32
pub fn ticks(&self) -> u64
pub fn input(&self, tick: u64) -> Option<&[u32]>
Sourcepub fn checkpoint(&mut self, tick: u64, state_hash: u64)
pub fn checkpoint(&mut self, tick: u64, state_hash: u64)
Panics unless tick is past the last checkpoint.
pub fn checkpoints(&self) -> &[Checkpoint]
pub fn encode(&self) -> Vec<u8> ⓘ
pub fn decode(bytes: &[u8]) -> Result<Self, TapeError>
Trait Implementations§
impl Eq for Tape
impl StructuralPartialEq for Tape
Auto Trait Implementations§
impl Freeze for Tape
impl RefUnwindSafe for Tape
impl Send for Tape
impl Sync for Tape
impl Unpin for Tape
impl UnsafeUnpin for Tape
impl UnwindSafe for Tape
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