pub struct MetadataIndex {
pub mode: CreationMode,
pub entries: Vec<IndexEntry>,
pub datasets: Vec<DatasetMetadata>,
}Expand description
The merged metadata index produced from one or more MetadataBlocks.
Fields§
§mode: CreationModeCreation mode used.
entries: Vec<IndexEntry>Ordered index entries (sorted by name for deterministic output).
datasets: Vec<DatasetMetadata>Flattened list of all dataset metadata, in entry order.
Implementations§
Source§impl MetadataIndex
impl MetadataIndex
Sourcepub fn from_collective(
datasets: Vec<DatasetMetadata>,
) -> Result<Self, FormatError>
pub fn from_collective( datasets: Vec<DatasetMetadata>, ) -> Result<Self, FormatError>
Create a collective-mode index from a single block of datasets.
Sourcepub fn merge_blocks(blocks: &[MetadataBlock]) -> Result<Self, FormatError>
pub fn merge_blocks(blocks: &[MetadataBlock]) -> Result<Self, FormatError>
Merge multiple independently created metadata blocks into a single index.
Returns an error if any two blocks contain datasets with the same name.
Sourcepub fn find(&self, name: &str) -> Option<&DatasetMetadata>
pub fn find(&self, name: &str) -> Option<&DatasetMetadata>
Look up a dataset by name.
Trait Implementations§
Source§impl Clone for MetadataIndex
impl Clone for MetadataIndex
Source§fn clone(&self) -> MetadataIndex
fn clone(&self) -> MetadataIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MetadataIndex
impl RefUnwindSafe for MetadataIndex
impl Send for MetadataIndex
impl Sync for MetadataIndex
impl Unpin for MetadataIndex
impl UnsafeUnpin for MetadataIndex
impl UnwindSafe for MetadataIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more