pub struct CustomEntropySource {
pub callback: EntropyCallback,
pub context: EntropyContext,
pub quality: EntropyQuality,
pub config: CustomEntropyConfig,
pub source_id: &'static str,
}Expand description
Custom entropy source registration
This structure manages the registration of custom entropy sources for the current thread.
Fields§
§callback: EntropyCallbackCallback function for entropy generation
context: EntropyContextContext data for the callback
quality: EntropyQualityQuality level of this entropy source
config: CustomEntropyConfigConfiguration for this entropy source
source_id: &'static strSource identifier
Implementations§
Source§impl CustomEntropySource
impl CustomEntropySource
Sourcepub const unsafe fn new(
callback: EntropyCallback,
context: EntropyContext,
quality: EntropyQuality,
config: CustomEntropyConfig,
source_id: &'static str,
) -> Self
pub const unsafe fn new( callback: EntropyCallback, context: EntropyContext, quality: EntropyQuality, config: CustomEntropyConfig, source_id: &'static str, ) -> Self
Create a new custom entropy source
§Arguments
callback- Function to call for entropy generationcontext- Context data for the callbackquality- Quality level of this entropy sourceconfig- Configuration for this entropy sourcesource_id- Unique identifier for this source
§Safety
The callback function must be thread-safe and must not cause
undefined behavior. The context.user_data must be valid for
context.size bytes if context.size > 0.
Sourcepub fn callback(&self) -> EntropyCallback
pub fn callback(&self) -> EntropyCallback
Get the callback function
Sourcepub fn context(&self) -> EntropyContext
pub fn context(&self) -> EntropyContext
Get the context data
Sourcepub fn quality(&self) -> EntropyQuality
pub fn quality(&self) -> EntropyQuality
Get the quality level
Sourcepub fn config(&self) -> &CustomEntropyConfig
pub fn config(&self) -> &CustomEntropyConfig
Get the configuration
Trait Implementations§
Source§impl Debug for CustomEntropySource
impl Debug for CustomEntropySource
Auto Trait Implementations§
impl Freeze for CustomEntropySource
impl RefUnwindSafe for CustomEntropySource
impl !Send for CustomEntropySource
impl !Sync for CustomEntropySource
impl Unpin for CustomEntropySource
impl UnsafeUnpin for CustomEntropySource
impl UnwindSafe for CustomEntropySource
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