File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,11 @@ impl ReseedingCore {
7575}
7676
7777/// The [`ThreadRng`] internal
78- struct ThreadRngCore {
78+ ///
79+ /// This type is the actual pseudo-random number generator that powers [`ThreadRng`]. The same
80+ /// Security design criteria and consideration as those of [`ThreadRng`] apply, whereas it allows
81+ /// users to utilize the same reseeding generator where `Send` or `Sync` is required.
82+ pub struct ThreadRngCore {
7983 inner : BlockRng < ReseedingCore > ,
8084}
8185
@@ -88,7 +92,7 @@ impl fmt::Debug for ThreadRngCore {
8892
8993impl ThreadRngCore {
9094 /// Initialize the generator using [`SysRng`]
91- fn new ( ) -> Result < Self , SysError > {
95+ pub fn new ( ) -> Result < Self , SysError > {
9296 Core :: try_from_rng ( & mut SysRng ) . map ( |result| Self {
9397 inner : BlockRng :: new ( ReseedingCore { inner : result } ) ,
9498 } )
@@ -97,7 +101,7 @@ impl ThreadRngCore {
97101 /// Immediately reseed the generator
98102 ///
99103 /// This discards any remaining random data in the cache.
100- fn reseed ( & mut self ) -> Result < ( ) , SysError > {
104+ pub fn reseed ( & mut self ) -> Result < ( ) , SysError > {
101105 self . inner . reset_and_skip ( 0 ) ;
102106 self . inner . core . reseed ( )
103107 }
You can’t perform that action at this time.
0 commit comments