pub trait SeekNum: Sized {
// Required methods
fn from_block_byte<T: Counter>(
block: T,
byte: u8,
bs: u8,
) -> Result<Self, OverflowError>;
fn into_block_byte<T: Counter>(
self,
bs: u8,
) -> Result<(T, u8), OverflowError>;
}
Expand description
Trait implemented for numeric types which can be used with the
StreamCipherSeek
trait.
This trait is implemented for i32
, u32
, u64
, u128
, and usize
.
It is not intended to be implemented in third-party crates.
Required Methods§
Sourcefn from_block_byte<T: Counter>(
block: T,
byte: u8,
bs: u8,
) -> Result<Self, OverflowError>
fn from_block_byte<T: Counter>( block: T, byte: u8, bs: u8, ) -> Result<Self, OverflowError>
Try to get position for block number block
, byte position inside
block byte
, and block size bs
.
Sourcefn into_block_byte<T: Counter>(self, bs: u8) -> Result<(T, u8), OverflowError>
fn into_block_byte<T: Counter>(self, bs: u8) -> Result<(T, u8), OverflowError>
Try to get block number and bytes position for given block size bs
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.