Dataset length

This commit is contained in:
2026-03-23 14:12:11 -07:00
parent 4737acbcf4
commit 9008a248c1
4 changed files with 20 additions and 0 deletions

View File

@@ -40,6 +40,13 @@ pub enum Dataset {
}
impl Dataset {
pub fn len(&self) -> usize {
match self {
Self::Dir(ds) => ds.len(),
Self::S3(ds) => ds.len(),
}
}
pub async fn get(&self, key: &str) -> Option<Item> {
match self {
Self::Dir(ds) => ds.get(key).await.ok().flatten(),