[−][src]Trait stream_cipher::SeekNum
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>
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>
Try to get block number and bytes position for given block size bs
.
Implementations on Foreign Types
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 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 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 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 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 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 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 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 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 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]
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]
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>