Trait StreamCipherSeek

pub trait StreamCipherSeek {
    // Required methods
    fn try_current_pos<T>(&self) -> Result<T, OverflowError>
       where T: SeekNum;
    fn try_seek<T>(&mut self, pos: T) -> Result<(), StreamCipherError>
       where T: SeekNum;

    // Provided methods
    fn current_pos<T>(&self) -> T
       where T: SeekNum { ... }
    fn seek<T>(&mut self, pos: T)
       where T: SeekNum { ... }
}
Expand description

Trait for seekable stream ciphers.

Methods of this trait are generic over the [SeekNum] trait, which is implemented for primitive numeric types, i.e.: i32, u32, u64, u128, and usize.

Required Methods§

fn try_current_pos<T>(&self) -> Result<T, OverflowError>
where T: SeekNum,

Try to get current keystream position

Returns [OverflowError] if position can not be represented by type T

fn try_seek<T>(&mut self, pos: T) -> Result<(), StreamCipherError>
where T: SeekNum,

Try to seek to the given position

Returns [StreamCipherError] if provided position value is bigger than keystream length.

Provided Methods§

fn current_pos<T>(&self) -> T
where T: SeekNum,

Get current keystream position

§Panics

If position can not be represented by type T

fn seek<T>(&mut self, pos: T)
where T: SeekNum,

Seek to the given position

§Panics

If provided position value is bigger than keystream length

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.

Implementors§

§

impl<T> StreamCipherSeek for StreamCipherCoreWrapper<T>
where T: StreamCipherSeekCore, <T as BlockSizeUser>::BlockSize: IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>, <<T as BlockSizeUser>::BlockSize as IsLess<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>, B0>, B0>, B0>>>::Output: NonZero,