pub trait SeekNum: Sized {
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.