Trait cipher::StreamCipherSeek
source · pub trait StreamCipherSeek {
// Required methods
fn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>;
fn try_seek<T: SeekNum>(&mut self, pos: T) -> Result<(), StreamCipherError>;
// Provided methods
fn current_pos<T: SeekNum>(&self) -> T { ... }
fn seek<T: SeekNum>(&mut self, pos: T) { ... }
}
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§
sourcefn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>
fn try_current_pos<T: SeekNum>(&self) -> Result<T, OverflowError>
Try to get current keystream position
Returns OverflowError
if position can not be represented by type T
sourcefn try_seek<T: SeekNum>(&mut self, pos: T) -> Result<(), StreamCipherError>
fn try_seek<T: SeekNum>(&mut self, pos: T) -> Result<(), StreamCipherError>
Try to seek to the given position
Returns StreamCipherError
if provided position value is bigger than
keystream length.
Provided Methods§
sourcefn current_pos<T: SeekNum>(&self) -> T
fn current_pos<T: SeekNum>(&self) -> T
Object Safety§
This trait is not object safe.