We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0292e1e commit eb206adCopy full SHA for eb206ad
1 file changed
libsql-wal/src/io/mod.rs
@@ -30,11 +30,16 @@ pub trait Io: Send + Sync + 'static {
30
// todo: create an async counterpart
31
fn tempfile(&self) -> io::Result<Self::TempFile>;
32
fn now(&self) -> DateTime<Utc>;
33
- fn uuid(&self) -> Uuid;
34
fn hard_link(&self, src: &Path, dst: &Path) -> io::Result<()>;
35
fn with_rng<F, R>(&self, f: F) -> R
36
where
37
F: FnOnce(&mut Self::Rng) -> R;
+ fn uuid(&self) -> uuid::Uuid {
38
+ self.with_rng(|rng| {
39
+ let n: u128 = rng.gen();
40
+ Uuid::from_u128(n)
41
+ })
42
+ }
43
}
44
45
#[derive(Default, Debug, Clone, Copy)]
0 commit comments