pub struct GlobalRng { /* private fields */ }Expand description
グローバルRNGインスタンスの管理 OS RNGの読み出しを共有し、統計と再取得タイミングを管理
Implementations§
Source§impl GlobalRng
impl GlobalRng
pub fn new() -> AppResult<Self>
Sourcepub fn generate_bytes(&self, dest: &mut [u8]) -> AppResult<()>
pub fn generate_bytes(&self, dest: &mut [u8]) -> AppResult<()>
指定されたバッファに乱数バイトを生成 統計に基づく再取得タイミング管理付き
Sourcepub fn get_statistics(&self) -> GlobalRngStatistics
pub fn get_statistics(&self) -> GlobalRngStatistics
統計情報を取得
Sourcepub fn stream(self: &Arc<Self>) -> GlobalRngStream
pub fn stream(self: &Arc<Self>) -> GlobalRngStream
グローバルRNGをオンデマンドで読み出すストリームを生成
Auto Trait Implementations§
impl !Freeze for GlobalRng
impl RefUnwindSafe for GlobalRng
impl Send for GlobalRng
impl Sync for GlobalRng
impl Unpin for GlobalRng
impl UnwindSafe for GlobalRng
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