1use crate::Error;
2use rand_core::{TryCryptoRng, TryRng};
3
4#[derive(#[automatically_derived]
impl ::core::clone::Clone for SysRng {
#[inline]
fn clone(&self) -> SysRng { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for SysRng { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for SysRng {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::write_str(f, "SysRng")
}
}Debug, #[automatically_derived]
impl ::core::default::Default for SysRng {
#[inline]
fn default() -> SysRng { SysRng {} }
}Default)]
34pub struct SysRng;
35
36impl TryRng for SysRng {
37 type Error = Error;
38
39 #[inline]
40 fn try_next_u32(&mut self) -> Result<u32, Error> {
41 crate::u32()
42 }
43
44 #[inline]
45 fn try_next_u64(&mut self) -> Result<u64, Error> {
46 crate::u64()
47 }
48
49 #[inline]
50 fn try_fill_bytes(&mut self, dest: &mut [u8]) -> Result<(), Error> {
51 crate::fill(dest)
52 }
53}
54
55impl TryCryptoRng for SysRng {}