Skip to main content

Module implementation

Module implementation 

Source
Available on getrandom_backend=extern_impl only.
Expand description

Attribute macros for overwriting the core functionality of this crate.

This allows getrandom to provide a default implementation and a common interface for all crates to use, while giving users a safe way to override that default where required.

Must be enabled via the extern_impl opt-in backend, as this functionality is currently limited to nightly.

Β§Examples

#[getrandom::implementation::fill_uninit]
fn my_fill_uninit_implementation(
    dest: &mut [MaybeUninit<u8>]
) -> Result<(), getrandom::Error> {
    // ...
}

Attribute MacrosΒ§

fill_uninit
Declares this function as an external implementation of fill_uninit.
u32
Declares this function as an external implementation of u32.
u64
Declares this function as an external implementation of u64.