Add len() and ops() to allow some introspection to DBTransaction

This commit is contained in:
David Palm 2019-04-16 12:21:11 +02:00
parent 19d71d3024
commit 4b870ce38a
1 changed files with 8 additions and 0 deletions

View File

@ -128,6 +128,14 @@ impl DBTransaction {
key: ekey,
});
}
pub fn len(&self) -> usize {
self.ops.len()
}
pub fn ops(&self) -> impl Iterator<Item = &DBOp> {
self.ops.iter()
}
}
/// Generic key-value database.