pub struct RandStream { /* private fields */ }Implementations§
Source§impl RandStream
impl RandStream
Sourcepub fn new(readers: Vec<Box<dyn Read>>) -> RandStream
pub fn new(readers: Vec<Box<dyn Read>>) -> RandStream
[new()] returns a new RandStream whih implements Stream that gets random data from the given
readers. If no reader was provided, a default RngCore is used.
Otherwise, for each source, 32 bytes are read. They are concatenated and
then hashed, and the resulting hash is used as a seed to a PRNG.
The resulting RandStream can be used in multiple threads.
Trait Implementations§
Source§impl Default for RandStream
impl Default for RandStream
Source§impl Stream for RandStream
impl Stream for RandStream
Source§fn xor_key_stream(
&mut self,
dst: &mut [u8],
src: &[u8],
) -> Result<(), StreamError>
fn xor_key_stream( &mut self, dst: &mut [u8], src: &[u8], ) -> Result<(), StreamError>
[
xor_key_stream()] XORs each byte in the given slice with a byte from the
cipher’s key stream; dst and src must overlap entirely or not at all. Read moreAuto Trait Implementations§
impl Freeze for RandStream
impl !RefUnwindSafe for RandStream
impl !Send for RandStream
impl !Sync for RandStream
impl Unpin for RandStream
impl !UnwindSafe for RandStream
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more