Struct re_viewer_context::ViewContext
source · pub struct ViewContext<'a> {
pub viewer_ctx: &'a ViewerContext<'a>,
pub view_id: SpaceViewId,
pub view_state: &'a dyn SpaceViewState,
pub defaults_path: &'a EntityPath,
pub visualizer_collection: Arc<VisualizerCollection>,
}
Expand description
The context associated with a view.
This combines our crate::ViewerContext
with crate::SpaceViewState
and other view-specific information. This is used as the interface for
execution of view systems and selection panel UI elements that happen
within the context of a view to simplify plumbing of the necessary
information to resolve a query with possible overrides and fallback values.
Fields§
§viewer_ctx: &'a ViewerContext<'a>
§view_id: SpaceViewId
§view_state: &'a dyn SpaceViewState
§defaults_path: &'a EntityPath
§visualizer_collection: Arc<VisualizerCollection>
Implementations§
source§impl<'a> ViewContext<'a>
impl<'a> ViewContext<'a>
pub fn query_context( &'a self, data_result: &'a DataResult, query: &'a LatestAtQuery ) -> QueryContext<'a>
sourcepub fn recording_engine(&self) -> StorageEngineReadGuard<'_>
pub fn recording_engine(&self) -> StorageEngineReadGuard<'_>
The StorageEngine
for the active recording.
sourcepub fn blueprint_db(&self) -> &EntityDb
pub fn blueprint_db(&self) -> &EntityDb
The active blueprint.
sourcepub fn recording_id(&self) -> StoreId
pub fn recording_id(&self) -> StoreId
The StoreId
of the active recording.
sourcepub fn selection(&self) -> &ItemCollection
pub fn selection(&self) -> &ItemCollection
Returns the current selection.
sourcepub fn hovered(&self) -> &ItemCollection
pub fn hovered(&self) -> &ItemCollection
Returns the currently hovered objects.
pub fn selection_state(&self) -> &ApplicationSelectionState
sourcepub fn current_query(&self) -> LatestAtQuery
pub fn current_query(&self) -> LatestAtQuery
The current time query, based on the current time control.
sourcepub fn select_hovered_on_click(
&self,
response: &Response,
selection: impl Into<ItemCollection>
)
pub fn select_hovered_on_click( &self, response: &Response, selection: impl Into<ItemCollection> )
Set hover/select/focus for a given selection based on an egui response.
pub fn lookup_query_result(&self, id: SpaceViewId) -> &DataQueryResult
pub fn save_blueprint_array( &self, entity_path: &EntityPath, component_name: ComponentName, array: Box<dyn ArrowArray> )
pub fn save_blueprint_archetype( &self, entity_path: &EntityPath, components: &dyn AsComponents )
pub fn save_blueprint_component( &self, entity_path: &EntityPath, components: &dyn ComponentBatch )
pub fn save_empty_blueprint_component<C>(&self, entity_path: &EntityPath)where
C: Component + 'a,
pub fn reset_blueprint_component_by_name( &self, entity_path: &EntityPath, component_name: ComponentName )
sourcepub fn clear_blueprint_component_by_name(
&self,
entity_path: &EntityPath,
component_name: ComponentName
)
pub fn clear_blueprint_component_by_name( &self, entity_path: &EntityPath, component_name: ComponentName )
Clears a component in the blueprint store by logging an empty array if it exists.
pub fn blueprint_timepoint_for_writes(&self) -> TimePoint
Auto Trait Implementations§
impl<'a> Freeze for ViewContext<'a>
impl<'a> !RefUnwindSafe for ViewContext<'a>
impl<'a> Send for ViewContext<'a>
impl<'a> Sync for ViewContext<'a>
impl<'a> Unpin for ViewContext<'a>
impl<'a> !UnwindSafe for ViewContext<'a>
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