pub trait SeekNum: Sized + TryInto<u8> + TryFrom<u8> + TryInto<i8> + TryFrom<i8> + TryInto<u16> + TryFrom<u16> + TryInto<i16> + TryFrom<i16> + TryInto<u32> + TryFrom<u32> + TryInto<i32> + TryFrom<i32> + TryInto<u64> + TryFrom<u64> + TryInto<i64> + TryFrom<i64> + TryInto<u128> + TryFrom<u128> + TryInto<i128> + TryFrom<i128> + TryInto<usize> + TryFrom<usize> + TryInto<isize> + TryFrom<isize> {
fn from_block_byte<T: SeekNum>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>;
fn to_block_byte<T: SeekNum>(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 primitive numeric types, i.e. i/u8,
u16, u32, u64, u128, usize, and i32. It is not intended
to be implemented in third-party crates.
Required Methods§
sourcefn from_block_byte<T: SeekNum>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn from_block_byte<T: SeekNum>(
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 to_block_byte<T: SeekNum>(self, bs: u8) -> Result<(T, u8), OverflowError>
fn to_block_byte<T: SeekNum>(self, bs: u8) -> Result<(T, u8), OverflowError>
Try to get block number and bytes position for given block size bs.