Trait cipher::stream::SeekNum [−][src]
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>; }
Trait implemented for numeric types which can be used with the
SyncStreamCipherSeek trait.
This trait is implemented for primitive numeric types, i.e. i/u8,
i/u16, i/u32, i/u64, i/u128, and i/usize. It is not intended
to be implemented in third-party crates.
Required methods
fn from_block_byte<T: SeekNum>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
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.
fn to_block_byte<T: SeekNum>(self, bs: u8) -> Result<(T, u8), OverflowError>[src]
Try to get block number and bytes position for given block size bs.
Implementors
impl SeekNum for i8[src]
impl SeekNum for i8[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for i16[src]
impl SeekNum for i16[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for i32[src]
impl SeekNum for i32[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for i64[src]
impl SeekNum for i64[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for i128[src]
impl SeekNum for i128[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for isize[src]
impl SeekNum for isize[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for u8[src]
impl SeekNum for u8[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for u16[src]
impl SeekNum for u16[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for u32[src]
impl SeekNum for u32[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for u64[src]
impl SeekNum for u64[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for u128[src]
impl SeekNum for u128[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>
impl SeekNum for usize[src]
impl SeekNum for usize[src]fn from_block_byte<T: TryInto<Self>>(
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>[src]
block: T,
byte: u8,
bs: u8
) -> Result<Self, OverflowError>
fn to_block_byte<T: TryFrom<Self>>(
self,
bs: u8
) -> Result<(T, u8), OverflowError>[src]
self,
bs: u8
) -> Result<(T, u8), OverflowError>