1use rand_core::RngCore;
2
3#[derive(Default, Debug)]
5pub struct PhantomRng;
6
7impl AsMut<Self> for PhantomRng {
8 fn as_mut(&mut self) -> &mut Self {
9 self
10 }
11}
12
13impl AsRef<Self> for PhantomRng {
14 fn as_ref(&self) -> &Self {
15 self
16 }
17}
18
19impl RngCore for PhantomRng {
20 fn next_u32(&mut self) -> u32 {
21 unreachable!("Should not be called!")
22 }
23
24 fn next_u64(&mut self) -> u64 {
25 unreachable!("Should not be called!")
26 }
27
28 fn fill_bytes(&mut self, _dst: &mut [u8]) {
29 unreachable!("Should not be called!")
30 }
31}