pub struct Rng { /* private fields */ }Expand description
Random number generator driver
Implementations§
Source§impl Rng
impl Rng
Sourcepub fn new(_rng: impl Peripheral<P = RNG>) -> Self
pub fn new(_rng: impl Peripheral<P = RNG>) -> Self
Create a new random number generator instance
Sourcepub fn read(&mut self, buffer: &mut [u8])
pub fn read(&mut self, buffer: &mut [u8])
Reads enough bytes from hardware random number generator to fill
buffer.
If any error is encountered then this function immediately returns. The contents of buf are unspecified in this case.
If this function returns an error, it is unspecified how many bytes it has read, but it will never read more than would be necessary to completely fill the buffer.
Trait Implementations§
Source§impl RngCore for Rng
impl RngCore for Rng
Source§fn fill_bytes(&mut self, dest: &mut [u8])
fn fill_bytes(&mut self, dest: &mut [u8])
Fill
dest with random data. Read moreimpl Copy for Rng
Auto Trait Implementations§
impl Freeze for Rng
impl RefUnwindSafe for Rng
impl Send for Rng
impl Sync for Rng
impl Unpin for Rng
impl UnwindSafe for Rng
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