pub struct SectionDatabase { /* private fields */ }Expand description
In-memory section database.
Implementations§
Source§impl SectionDatabase
impl SectionDatabase
pub fn new() -> Self
Sourcepub fn add(&mut self, entry: SectionEntry)
pub fn add(&mut self, entry: SectionEntry)
Add a section entry to the database.
Sourcepub fn add_many(&mut self, entries: Vec<SectionEntry>)
pub fn add_many(&mut self, entries: Vec<SectionEntry>)
Add multiple entries.
Sourcepub fn get_by_name(&self, name: &str) -> Option<&SectionEntry>
pub fn get_by_name(&self, name: &str) -> Option<&SectionEntry>
Get entry by name.
Sourcepub fn get_by_designation(&self, designation: &str) -> Option<&SectionEntry>
pub fn get_by_designation(&self, designation: &str) -> Option<&SectionEntry>
Get entry by designation.
Sourcepub fn get_by_tag(&self, tag: &str) -> Vec<&SectionEntry>
pub fn get_by_tag(&self, tag: &str) -> Vec<&SectionEntry>
Get entries by tag.
Sourcepub fn search(&self, filter: &SearchFilter) -> Vec<SearchResult>
pub fn search(&self, filter: &SearchFilter) -> Vec<SearchResult>
Search with filter. All specified criteria must match (AND logic).
Sourcepub fn find_similar(
&self,
reference: &Section,
tolerance: f64,
) -> Vec<SearchResult>
pub fn find_similar( &self, reference: &Section, tolerance: f64, ) -> Vec<SearchResult>
Find sections similar to a reference section.
Sourcepub fn all(&self) -> &[SectionEntry]
pub fn all(&self) -> &[SectionEntry]
Get all entries.
Trait Implementations§
Source§impl Debug for SectionDatabase
impl Debug for SectionDatabase
Auto Trait Implementations§
impl !RefUnwindSafe for SectionDatabase
impl !Send for SectionDatabase
impl !Sync for SectionDatabase
impl !UnwindSafe for SectionDatabase
impl Forget for SectionDatabase
impl Freeze for SectionDatabase
impl Move for SectionDatabase
impl Unpin for SectionDatabase
impl UnsafeUnpin for SectionDatabase
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