@@ -35,30 +35,29 @@ pub use sys_rng::SysRng;
3535
3636pub use crate :: error:: { Error , RawOsError } ;
3737
38+ /// Provides Externally Implementable Interfaces for the core functionality of this crate.
39+ /// This allows `getrandom` to provide a default implementation and a common interface
40+ /// for all crates to use, while giving users a safe way to override that default where required.
41+ ///
42+ /// Must be enabled via the `extern_item_impls` opt-in backend, as this functionality
43+ /// is currently limited to nightly.
44+ ///
45+ /// # Examples
46+ ///
47+ /// ```rust
48+ /// # use core::mem::MaybeUninit;
49+ /// # #[cfg(getrandom_backend = "extern_item_impls")]
50+ /// #[getrandom::implementation::fill_uninit]
51+ /// fn my_fill_uninit_implementation(
52+ /// dest: &mut [MaybeUninit<u8>]
53+ /// ) -> Result<(), getrandom::Error> {
54+ /// // ...
55+ /// # let _ = dest;
56+ /// # Err(Error::UNSUPPORTED)
57+ /// }
58+ /// ```
3859#[ cfg( getrandom_backend = "extern_item_impls" ) ]
3960pub mod implementation {
40- //! Provides Externally Implementable Interfaces for the core functionality of this crate.
41- //! This allows `getrandom` to provide a default implementation and a common interface
42- //! for all crates to use, while giving users a safe way to override that default where required.
43- //!
44- //! Must be enabled via the `extern_item_impls` opt-in backend, as this functionality
45- //! is currently limited to nightly.
46- //!
47- //! # Examples
48- //!
49- //! ```rust
50- //! # use core::mem::MaybeUninit;
51- //! # #[cfg(getrandom_backend = "extern_item_impls")]
52- //! #[getrandom::implementation::fill_uninit]
53- //! fn my_fill_uninit_implementation(
54- //! dest: &mut [MaybeUninit<u8>]
55- //! ) -> Result<(), getrandom::Error> {
56- //! // ...
57- //! # let _ = dest;
58- //! # Err(Error::UNSUPPORTED)
59- //! }
60- //! ```
61-
6261 pub use crate :: backends:: extern_item_impls:: { fill_uninit, u32, u64} ;
6362}
6463
0 commit comments