pub enum ArchiveMeta {
NoMetadata,
Index(MetaIndex),
}Expand description
What an archive has to say about metadata.
Deliberately not an Option and deliberately without Default. The two
states below are different facts, and a reader that cannot tell them apart
reports “searched, found nothing” about an archive it never searched. There is
no unwrap_or_default() that can silently turn the first into the second.
Variants§
NoMetadata
This archive carries no metadata section at all — it predates the module, or its writer sealed none. Nothing was searched; nothing can be concluded about what it does or does not contain.
Index(MetaIndex)
The section is present and decoded. It may hold zero rows, which is a genuine answer: this archive records nothing under any key.
Implementations§
Source§impl ArchiveMeta
impl ArchiveMeta
Sourcepub fn index(&self) -> Option<&MetaIndex>
pub fn index(&self) -> Option<&MetaIndex>
The index, or None when the archive has no section. Explicit by design:
the caller has to name the absent case.
Sourcepub fn is_searchable(&self) -> bool
pub fn is_searchable(&self) -> bool
true when there was an index to search at all.
Sourcepub fn find_by_key(&self, key: &str) -> MetaSearch<'_>
pub fn find_by_key(&self, key: &str) -> MetaSearch<'_>
Key search that keeps the distinction all the way to the call site.
Sourcepub fn find_by_prefix(&self, prefix: &str) -> MetaSearch<'_>
pub fn find_by_prefix(&self, prefix: &str) -> MetaSearch<'_>
Prefix search that keeps the distinction all the way to the call site.
Trait Implementations§
Source§impl Clone for ArchiveMeta
impl Clone for ArchiveMeta
Source§fn clone(&self) -> ArchiveMeta
fn clone(&self) -> ArchiveMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more