Struct re_entity_db::entity_tree::EntityTree
source · pub struct EntityTree {
pub path: EntityPath,
pub children: BTreeMap<EntityPathPart, EntityTree>,
pub entity: EntityInfo,
pub subtree: SubtreeInfo,
}
Expand description
A recursive, manually updated re_data_store::StoreSubscriber
that maintains the entity hierarchy.
The tree contains a list of subtrees, and so on recursively.
Fields§
§path: EntityPath
Full path prefix to the root of this (sub)tree.
children: BTreeMap<EntityPathPart, EntityTree>
Direct descendants of this (sub)tree.
entity: EntityInfo
Information about this specific entity (excluding children).
subtree: SubtreeInfo
Info about this subtree, including all children, recursively.
Implementations§
source§impl EntityTree
impl EntityTree
pub fn root() -> Self
pub fn new( path: EntityPath, recursive_clears: BTreeMap<RowId, TimePoint> ) -> Self
pub fn num_children_and_fields(&self) -> usize
sourcepub fn num_static_messages_recursive(&self) -> u64
pub fn num_static_messages_recursive(&self) -> u64
Number of timeless messages in this tree, or any child, recursively.
pub fn time_histogram_for_component( &self, timeline: &Timeline, component_name: impl Into<ComponentName> ) -> Option<&TimeHistogram>
sourcepub fn on_store_additions(&mut self, events: &[StoreEvent]) -> ClearCascade
pub fn on_store_additions(&mut self, events: &[StoreEvent]) -> ClearCascade
Updates the EntityTree
by applying a batch of StoreEvent
s.
Returns an ClearCascade
that describes the cascading side-effects to be applied to the
DataStore
as a result, if any.
See ClearCascade
’s documentation for more information.
Only reacts to additions (event.kind == StoreDiffKind::Addition
).
sourcepub fn on_store_deletions(
&mut self,
store_events: &[&StoreEvent],
compacted: &CompactedStoreEvents
)
pub fn on_store_deletions( &mut self, store_events: &[&StoreEvent], compacted: &CompactedStoreEvents )
Updates the EntityTree
by applying a batch of StoreEvent
s.
Returns an ClearCascade
that describes a list of deletions that should be applied
to the store as a result.
Only reacts to additions (event.kind == StoreDiffKind::Addition
).
pub fn subtree(&self, path: &EntityPath) -> Option<&Self>
pub fn visit_children_recursively( &self, visitor: &mut impl FnMut(&EntityPath, &EntityInfo) )
Trait Implementations§
source§impl StoreSubscriber for EntityTree
impl StoreSubscriber for EntityTree
Auto Trait Implementations§
impl Freeze for EntityTree
impl RefUnwindSafe for EntityTree
impl Send for EntityTree
impl Sync for EntityTree
impl Unpin for EntityTree
impl UnwindSafe for EntityTree
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>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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