pub struct ViewIndex { /* private fields */ }Implementations§
Source§impl ViewIndex
impl ViewIndex
pub fn new() -> Self
Sourcepub fn set_entity_scope(&mut self, export: impl Into<String>, field: ScopeField)
pub fn set_entity_scope(&mut self, export: impl Into<String>, field: ScopeField)
Scope an entity’s rows by field (row scoping, see
crate::row_scope): every view of the entity, derived views
included, then delivers a row only to sessions whose row scopes cover
it, and its sorted views keep their rows per scope.
Call while building the index, before it is shared.
Sourcepub fn set_max_scope_partitions(&mut self, max_partitions: usize)
pub fn set_max_scope_partitions(&mut self, max_partitions: usize)
Cap the scope partitions each sorted view of a scoped entity keeps
(default DEFAULT_MAX_SCOPE_PARTITIONS). See
SortedViewCache::partition_by_scope.
pub fn max_scope_partitions(&self) -> usize
Sourcepub fn scope_field_for_view(&self, view_id: &str) -> Option<&ScopeField>
pub fn scope_field_for_view(&self, view_id: &str) -> Option<&ScopeField>
The scope field governing a view’s rows: its entity’s, for the view
or any view it derives from. None for views of unscoped entities.
Sourcepub fn has_scoped_entities(&self) -> bool
pub fn has_scoped_entities(&self) -> bool
Whether any entity is row-scoped.
pub fn add_spec(&mut self, spec: ViewSpec)
pub fn by_export(&self, entity: &str) -> &[ViewSpec]
pub fn get_view(&self, id: &str) -> Option<&ViewSpec>
pub fn get_derived_views(&self) -> Vec<&ViewSpec>
pub fn get_derived_views_for_source( &self, source_view_id: &str, ) -> Vec<&ViewSpec>
pub fn sorted_caches(&self) -> Arc<RwLock<HashMap<String, SortedViewCache>>> ⓘ
pub async fn init_sorted_cache( &self, view_id: &str, sort_field: Vec<String>, order: SortOrder, )
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ViewIndex
impl !UnwindSafe for ViewIndex
impl Freeze for ViewIndex
impl Send for ViewIndex
impl Sync for ViewIndex
impl Unpin for ViewIndex
impl UnsafeUnpin for ViewIndex
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