pub struct EntryIndex { /* private fields */ }Expand description
Entries in file order plus an id index (latest entry wins on duplicate ids).
Implementations§
Source§impl EntryIndex
impl EntryIndex
Sourcepub fn new(entries: Vec<SessionEntry>) -> Self
pub fn new(entries: Vec<SessionEntry>) -> Self
Indexes entries (file order).
Sourcepub fn push(&mut self, entry: SessionEntry)
pub fn push(&mut self, entry: SessionEntry)
Appends an entry.
Sourcepub fn get(&self, id: &EntryId) -> Option<&SessionEntry>
pub fn get(&self, id: &EntryId) -> Option<&SessionEntry>
Entry by id.
Sourcepub fn contains_str(&self, id: &str) -> bool
pub fn contains_str(&self, id: &str) -> bool
Whether the id text is present.
Sourcepub fn entries(&self) -> &[SessionEntry]
pub fn entries(&self) -> &[SessionEntry]
All entries in file order.
Sourcepub fn into_entries(self) -> Vec<SessionEntry>
pub fn into_entries(self) -> Vec<SessionEntry>
Consumes the index.
Trait Implementations§
Source§impl Clone for EntryIndex
impl Clone for EntryIndex
Source§impl Debug for EntryIndex
impl Debug for EntryIndex
Source§impl Default for EntryIndex
impl Default for EntryIndex
Source§impl FromIterator<SessionEntry> for EntryIndex
impl FromIterator<SessionEntry> for EntryIndex
Source§fn from_iter<I: IntoIterator<Item = SessionEntry>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = SessionEntry>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl PartialEq for EntryIndex
impl PartialEq for EntryIndex
impl StructuralPartialEq for EntryIndex
Auto Trait Implementations§
impl Freeze for EntryIndex
impl RefUnwindSafe for EntryIndex
impl Send for EntryIndex
impl Sync for EntryIndex
impl Unpin for EntryIndex
impl UnsafeUnpin for EntryIndex
impl UnwindSafe for EntryIndex
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