diff options
Diffstat (limited to 'rust/src/metadata.rs')
| -rw-r--r-- | rust/src/metadata.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/rust/src/metadata.rs b/rust/src/metadata.rs index 120a08b7..b17ba41c 100644 --- a/rust/src/metadata.rs +++ b/rust/src/metadata.rs @@ -1,4 +1,3 @@ -#[allow(non_snake_case)] use crate::rc::{ Array, CoreArrayProvider, CoreArrayWrapper, CoreOwnedArrayProvider, Guard, Ref, RefCountable, }; @@ -236,6 +235,10 @@ impl Metadata { unsafe { BNMetadataSize(self.handle) } } + pub fn is_empty(&self) -> bool { + unsafe { BNMetadataSize(self.handle) == 0 } + } + pub fn index(&self, index: usize) -> Result<Option<Ref<Metadata>>, ()> { if self.get_type() != MetadataType::ArrayDataType { return Err(()); |
