@@ -51,29 +51,21 @@ impl<'py> BitGeneratorMethods<'py> for Bound<'py, BitGenerator> {
51
51
/// Wrapper for [`npy_bitgen`]
52
52
pub struct BitGen < ' a > ( & ' a mut npy_bitgen ) ;
53
53
54
- /// Methods for [`BitGen`]
55
- pub trait BitGenMethods {
54
+ impl < ' py > BitGen < ' py > {
56
55
/// Returns the next random unsigned 64 bit integer
57
- fn next_uint64 ( & self ) -> u64 ;
58
- /// Returns the next random unsigned 32 bit integer
59
- fn next_uint32 ( & self ) -> u32 ;
60
- /// Returns the next random double
61
- fn next_double ( & self ) -> libc:: c_double ;
62
- /// Returns the next raw value (can be used for testing)
63
- fn next_raw ( & self ) -> u64 ;
64
- }
65
-
66
- impl < ' py > BitGenMethods for BitGen < ' py > {
67
- fn next_uint64 ( & self ) -> u64 {
56
+ pub fn next_uint64 ( & self ) -> u64 {
68
57
unsafe { ( self . 0 . next_uint64 ) ( self . 0 . state ) }
69
58
}
70
- fn next_uint32 ( & self ) -> u32 {
59
+ /// Returns the next random unsigned 32 bit integer
60
+ pub fn next_uint32 ( & self ) -> u32 {
71
61
unsafe { ( self . 0 . next_uint32 ) ( self . 0 . state ) }
72
62
}
73
- fn next_double ( & self ) -> libc:: c_double {
63
+ /// Returns the next random double
64
+ pub fn next_double ( & self ) -> libc:: c_double {
74
65
unsafe { ( self . 0 . next_double ) ( self . 0 . state ) }
75
66
}
76
- fn next_raw ( & self ) -> u64 {
67
+ /// Returns the next raw value (can be used for testing)
68
+ pub fn next_raw ( & self ) -> u64 {
77
69
unsafe { ( self . 0 . next_raw ) ( self . 0 . state ) }
78
70
}
79
71
}
0 commit comments