pub struct SpatialTopology {
subspaces: IntMap<EntityPathHash, SubSpace>,
subspace_origin_per_logged_entity: IntMap<EntityPathHash, EntityPathHash>,
}
Expand description
Spatial topological information about a store.
Describes how 2D & 3D spaces are connected/disconnected.
Used to determine whether 2D/3D visualizers are applicable and to inform space view generation heuristics.
Spatial topology is time independent but may change as new data comes in. Generally, the assumption is that topological cuts stay constant over time.
Fields§
§subspaces: IntMap<EntityPathHash, SubSpace>
All subspaces, identified by their origin-hash.
subspace_origin_per_logged_entity: IntMap<EntityPathHash, EntityPathHash>
Maps each logged entity to the origin of a subspace.
This is purely an optimization to speed up searching for subspaces
.
Implementations§
source§impl SpatialTopology
impl SpatialTopology
sourcepub fn access<T>(store_id: &StoreId, f: impl FnOnce(&Self) -> T) -> Option<T>
pub fn access<T>(store_id: &StoreId, f: impl FnOnce(&Self) -> T) -> Option<T>
Accesses the spatial topology for a given store.
sourcepub fn subspace_for_entity(&self, entity: &EntityPath) -> &SubSpace
pub fn subspace_for_entity(&self, entity: &EntityPath) -> &SubSpace
Returns the subspace an entity belongs to.
sourcepub fn iter_subspaces(&self) -> impl Iterator<Item = &SubSpace>
pub fn iter_subspaces(&self) -> impl Iterator<Item = &SubSpace>
Iterates over all subspaces.
fn subspace_origin_hash_for_entity(&self, entity: &EntityPath) -> EntityPathHash
sourcepub fn subspace_for_subspace_origin(
&self,
origin: EntityPathHash
) -> Option<&SubSpace>
pub fn subspace_for_subspace_origin( &self, origin: EntityPathHash ) -> Option<&SubSpace>
Returns the subspace for a given origin.
None if the origin doesn’t identify its own subspace.
fn on_store_diff( &mut self, entity_path: &EntityPath, added_components: impl Iterator<Item = ComponentName> )
fn update_space_with_new_connections( &mut self, entity_path: &EntityPath, subspace_origin_hash: EntityPathHash, new_connections: SubSpaceConnectionFlags )
sourcefn add_new_entity(
&mut self,
entity_path: &EntityPath,
subspace_connections: SubSpaceConnectionFlags
)
fn add_new_entity( &mut self, entity_path: &EntityPath, subspace_connections: SubSpaceConnectionFlags )
Adds a new entity to the spatial topology that wasn’t known before.
fn split_subspace( &mut self, split_subspace_origin_hash: EntityPathHash, new_space_origin: &EntityPath, connection_to_parent: SubSpaceConnectionFlags )
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpatialTopology
impl RefUnwindSafe for SpatialTopology
impl Send for SpatialTopology
impl Sync for SpatialTopology
impl Unpin for SpatialTopology
impl UnwindSafe for SpatialTopology
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request