Dataset length
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user