pub struct SortedViewCache { /* private fields */ }Expand description
Sorted view cache maintaining entities in sort order
Implementations§
Source§impl SortedViewCache
impl SortedViewCache
pub fn new(view_id: String, sort_field: Vec<String>, order: SortOrder) -> Self
pub fn view_id(&self) -> &str
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn upsert(&mut self, entity_key: String, entity: Value) -> UpsertResult
pub fn upsert(&mut self, entity_key: String, entity: Value) -> UpsertResult
Insert or update an entity, returns the position where it was inserted
Sourcepub fn remove(&mut self, entity_key: &str) -> Option<usize>
pub fn remove(&mut self, entity_key: &str) -> Option<usize>
Remove an entity, returns the position it was at
Sourcepub fn ordered_keys(&mut self) -> &[String]
pub fn ordered_keys(&mut self) -> &[String]
Get ordered keys (rebuilds cache if dirty)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SortedViewCache
impl RefUnwindSafe for SortedViewCache
impl Send for SortedViewCache
impl Sync for SortedViewCache
impl Unpin for SortedViewCache
impl UnwindSafe for SortedViewCache
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