pub struct CacheIndexes {
pub projects_by_id: HashMap<String, usize>,
pub projects_by_name: HashMap<String, usize>,
pub sections_by_id: HashMap<String, usize>,
pub sections_by_name: HashMap<String, Vec<(String, usize)>>,
pub labels_by_id: HashMap<String, usize>,
pub labels_by_name: HashMap<String, usize>,
pub items_by_id: HashMap<String, usize>,
pub collaborators_by_id: HashMap<String, usize>,
pub collaborators_by_project: HashMap<String, Vec<String>>,
}Expand description
Indexes for O(1) cache lookups.
These indexes are rebuilt after every sync operation and when loading the cache from disk. They map IDs and lowercase names to indices in the corresponding vectors, enabling fast lookups without linear searches.
Fields§
§projects_by_id: HashMap<String, usize>Project ID -> index in projects vec.
projects_by_name: HashMap<String, usize>Lowercase project name -> index in projects vec.
sections_by_id: HashMap<String, usize>Section ID -> index in sections vec.
sections_by_name: HashMap<String, Vec<(String, usize)>>Lowercase section name -> list of (project_id, index in sections vec). Multiple sections can have the same name across different projects.
labels_by_id: HashMap<String, usize>Label ID -> index in labels vec.
labels_by_name: HashMap<String, usize>Lowercase label name -> index in labels vec.
items_by_id: HashMap<String, usize>Item ID -> index in items vec.
collaborators_by_id: HashMap<String, usize>Collaborator user ID -> index in collaborators vec.
collaborators_by_project: HashMap<String, Vec<String>>Project ID -> list of collaborator user IDs for that project.
Trait Implementations§
Source§impl Clone for CacheIndexes
impl Clone for CacheIndexes
Source§fn clone(&self) -> CacheIndexes
fn clone(&self) -> CacheIndexes
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheIndexes
impl Debug for CacheIndexes
Source§impl Default for CacheIndexes
impl Default for CacheIndexes
Source§fn default() -> CacheIndexes
fn default() -> CacheIndexes
Returns the “default value” for a type. Read more
Source§impl PartialEq for CacheIndexes
impl PartialEq for CacheIndexes
impl StructuralPartialEq for CacheIndexes
Auto Trait Implementations§
impl Freeze for CacheIndexes
impl RefUnwindSafe for CacheIndexes
impl Send for CacheIndexes
impl Sync for CacheIndexes
impl Unpin for CacheIndexes
impl UnsafeUnpin for CacheIndexes
impl UnwindSafe for CacheIndexes
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