pub enum LinuxRandomMode {
Secure,
SecureNonblock,
Insecure,
}linux only.Expand description
๐ฒ ๐ง
Linux getrandom randomness mode.
๐ sys/os/linux
This selects the Linux getrandom policy
used by the configurable Linux::random_*_with methods.
The default mode is SecureNonblock, exposed as
Linux::RANDOM_MODE. It requests cryptographic random bytes without
blocking; if the kernel randomness source is not ready, the operation
returns an error instead.
Variantsยง
Secure
Cryptographic randomness, allowing the syscall to block.
This uses no getrandom flags.
SecureNonblock
Cryptographic randomness without blocking.
This uses GRND_NONBLOCK. If the kernel randomness source is not ready,
the syscall may fail with EAGAIN.
Insecure
Non-cryptographic random bytes.
This uses GRND_INSECURE and is suitable only
when cryptographic quality is not required.
Implementationsยง
Sourceยงimpl LinuxRandomMode
impl LinuxRandomMode
Sourcepub const fn is_cryptographic(self) -> bool
pub const fn is_cryptographic(self) -> bool
Returns whether this mode is intended for cryptographic randomness.
Trait Implementationsยง
Sourceยงimpl Clone for LinuxRandomMode
impl Clone for LinuxRandomMode
Sourceยงfn clone(&self) -> LinuxRandomMode
fn clone(&self) -> LinuxRandomMode
1.0.0 (const: unstable) ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LinuxRandomMode
Sourceยงimpl Debug for LinuxRandomMode
impl Debug for LinuxRandomMode
Sourceยงimpl Default for LinuxRandomMode
impl Default for LinuxRandomMode
Sourceยงfn default() -> LinuxRandomMode
fn default() -> LinuxRandomMode
impl Eq for LinuxRandomMode
Sourceยงimpl PartialEq for LinuxRandomMode
impl PartialEq for LinuxRandomMode
Sourceยงfn eq(&self, other: &LinuxRandomMode) -> bool
fn eq(&self, other: &LinuxRandomMode) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LinuxRandomMode
Auto Trait Implementationsยง
impl Freeze for LinuxRandomMode
impl RefUnwindSafe for LinuxRandomMode
impl Send for LinuxRandomMode
impl Sync for LinuxRandomMode
impl Unpin for LinuxRandomMode
impl UnsafeUnpin for LinuxRandomMode
impl UnwindSafe for LinuxRandomMode
Blanket Implementationsยง
Sourceยงimpl<T> AnyExt for T
impl<T> AnyExt for T
Sourceยงfn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId of Self using a custom hasher.Sourceยงfn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Sourceยงfn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
fn as_any_box(self: Box<Self>) -> Box<dyn Any>where
Self: Sized,
alloc only.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
Sourceยงimpl<T> ByteSized for T
impl<T> ByteSized for T
Sourceยงconst BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Sourceยงfn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Sourceยงfn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Sourceยงimpl<T> MemExt for Twhere
T: ?Sized,
impl<T> MemExt for Twhere
T: ?Sized,
Sourceยงconst NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Sourceยงfn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Sourceยงfn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Sourceยงfn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Sourceยงfn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Sourceยงfn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true if dropping values of this type matters. Read moreSourceยงfn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self without running its destructor. Read moreSourceยงfn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Sourceยงunsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงunsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout only.T represented by the all-zero byte-pattern. Read moreSourceยงfn mem_as_bytes(&self) -> &[u8] โ
fn mem_as_bytes(&self) -> &[u8] โ
unsafe_slice only.