Struct re_query::QueryCache
source · pub struct QueryCache {
pub(crate) store: ChunkStoreHandle,
pub(crate) store_id: StoreId,
pub(crate) might_require_clearing: RwLock<IntSet<EntityPath>>,
pub(crate) latest_at_per_cache_key: RwLock<HashMap<QueryCacheKey, Arc<RwLock<LatestAtCache>>>>,
pub(crate) range_per_cache_key: RwLock<HashMap<QueryCacheKey, Arc<RwLock<RangeCache>>>>,
}
Fields§
§store: ChunkStoreHandle
Handle to the associated [ChunkStoreHandle
].
store_id: StoreId
The [StoreId
] of the associated [ChunkStoreHandle
].
might_require_clearing: RwLock<IntSet<EntityPath>>
Keeps track of which entities have had any Clear
-related data on any timeline at any
point in time.
This is used to optimized read-time clears, so that we don’t unnecessarily pay for the fixed overhead of all the query layers when we know for a fact that there won’t be any data there. This is a huge performance improvement in practice, especially in recordings with many entities.
latest_at_per_cache_key: RwLock<HashMap<QueryCacheKey, Arc<RwLock<LatestAtCache>>>>
§range_per_cache_key: RwLock<HashMap<QueryCacheKey, Arc<RwLock<RangeCache>>>>
Implementations§
source§impl QueryCache
impl QueryCache
pub fn new(store: ChunkStoreHandle) -> Self
pub fn new_handle(store: ChunkStoreHandle) -> QueryCacheHandle
pub fn clear(&self)
source§impl QueryCache
impl QueryCache
sourcepub fn stats(&self) -> CachesStats
pub fn stats(&self) -> CachesStats
Computes the stats for all primary caches.
source§impl QueryCache
impl QueryCache
sourcepub fn latest_at(
&self,
query: &LatestAtQuery,
entity_path: &EntityPath,
component_names: impl IntoIterator<Item = ComponentName>
) -> LatestAtResults
pub fn latest_at( &self, query: &LatestAtQuery, entity_path: &EntityPath, component_names: impl IntoIterator<Item = ComponentName> ) -> LatestAtResults
Queries for the given component_names
using latest-at semantics.
See LatestAtResults
for more information about how to handle the results.
This is a cached API – data will be lazily cached upon access.
sourcepub fn purge_fraction_of_ram(&mut self, fraction_to_purge: f32)
pub fn purge_fraction_of_ram(&mut self, fraction_to_purge: f32)
Free up some RAM by forgetting the older parts of all timelines.
source§impl QueryCache
impl QueryCache
sourcepub fn range(
&self,
query: &RangeQuery,
entity_path: &EntityPath,
component_names: impl IntoIterator<Item = ComponentName>
) -> RangeResults
pub fn range( &self, query: &RangeQuery, entity_path: &EntityPath, component_names: impl IntoIterator<Item = ComponentName> ) -> RangeResults
Queries for the given component_names
using range semantics.
See RangeResults
for more information about how to handle the results.
This is a cached API – data will be lazily cached upon access.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for QueryCache
impl !RefUnwindSafe for QueryCache
impl Send for QueryCache
impl Sync for QueryCache
impl Unpin for QueryCache
impl !UnwindSafe for QueryCache
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more