Struct re_viewport::viewport::Viewport
source · pub struct Viewport<'a> {
pub blueprint: &'a ViewportBlueprint,
pub tree: Tree<SpaceViewId>,
pub tree_edited: bool,
tree_action_receiver: Receiver<TreeAction>,
tree_action_sender: Sender<TreeAction>,
}
Expand description
Defines the layout of the Viewport
Fields§
§blueprint: &'a ViewportBlueprint
The blueprint that drives this viewport. This is the source of truth from the store for this frame.
tree: Tree<SpaceViewId>
The [egui_tiles::Tree
] tree that actually manages blueprint layout. This tree needs
to be mutable for things like drag-and-drop and is ultimately saved back to the store.
at the end of the frame if edited.
tree_edited: bool
Should be set to true
whenever a tree modification should be back-ported to the blueprint
store. That should only happen as a result of a user action.
tree_action_receiver: Receiver<TreeAction>
Actions to perform at the end of the frame.
We delay any modifications to the tree until the end of the frame, so that we don’t mutate something while inspecting it.
tree_action_sender: Sender<TreeAction>
Tree action sender
Used to pass along TabViewer
.
Implementations§
source§impl<'a> Viewport<'a>
impl<'a> Viewport<'a>
pub fn new( blueprint: &'a ViewportBlueprint, space_view_class_registry: &SpaceViewClassRegistry, tree_action_receiver: Receiver<TreeAction>, tree_action_sender: Sender<TreeAction> ) -> Self
pub fn viewport_ui( &mut self, ui: &mut Ui, ctx: &'a ViewerContext<'_>, view_states: &mut ViewStates )
pub fn on_frame_start(&mut self, ctx: &ViewerContext<'_>)
sourcepub fn update_and_sync_tile_tree_to_blueprint(self, ctx: &ViewerContext<'_>)
pub fn update_and_sync_tile_tree_to_blueprint(self, ctx: &ViewerContext<'_>)
Process any deferred TreeActions
and then sync to blueprint
sourcepub fn is_item_valid(
&self,
store_context: &StoreContext<'_>,
item: &Item
) -> bool
pub fn is_item_valid( &self, store_context: &StoreContext<'_>, item: &Item ) -> bool
If false
, the item is referring to data that is not present in this blueprint.
Auto Trait Implementations§
impl<'a> Freeze for Viewport<'a>
impl<'a> !RefUnwindSafe for Viewport<'a>
impl<'a> Send for Viewport<'a>
impl<'a> !Sync for Viewport<'a>
impl<'a> Unpin for Viewport<'a>
impl<'a> !UnwindSafe for Viewport<'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> 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