pub struct ContainerBlueprint {
pub id: ContainerId,
pub container_kind: ContainerKind,
pub display_name: Option<String>,
pub contents: Vec<Contents>,
pub col_shares: Vec<f32>,
pub row_shares: Vec<f32>,
pub active_tab: Option<Contents>,
pub visible: bool,
pub grid_columns: Option<u32>,
}
Expand description
The native version of a re_types_blueprint::blueprint::archetypes::ContainerBlueprint
.
This represents a single container in the blueprint. On each frame, it is
used to populate an [egui_tiles::Container
]. Each child in contents
can
be either a SpaceViewId
or another ContainerId
.
The main reason this exists is to handle type conversions that aren’t yet well handled by the code-generated archetypes.
Fields§
§id: ContainerId
§container_kind: ContainerKind
§display_name: Option<String>
§contents: Vec<Contents>
§active_tab: Option<Contents>
§visible: bool
§grid_columns: Option<u32>
Implementations§
source§impl ContainerBlueprint
impl ContainerBlueprint
sourcepub fn try_from_db(
blueprint_db: &EntityDb,
query: &LatestAtQuery,
id: ContainerId
) -> Option<Self>
pub fn try_from_db( blueprint_db: &EntityDb, query: &LatestAtQuery, id: ContainerId ) -> Option<Self>
Attempt to load a ContainerBlueprint
from the blueprint store.
pub fn entity_path(&self) -> EntityPath
sourcepub fn save_to_blueprint_store(&self, ctx: &ViewerContext<'_>)
pub fn save_to_blueprint_store(&self, ctx: &ViewerContext<'_>)
Persist the entire ContainerBlueprint
to the blueprint store.
This only needs to be called if the ContainerBlueprint
was created with Self::from_egui_tiles_container
.
Otherwise, incremental calls to set_
functions will write just the necessary component
update directly to the store.
sourcepub fn from_egui_tiles_container(
container_id: ContainerId,
container: &Container,
visible: bool,
tile_to_contents: &HashMap<TileId, Contents>
) -> Self
pub fn from_egui_tiles_container( container_id: ContainerId, container: &Container, visible: bool, tile_to_contents: &HashMap<TileId, Contents> ) -> Self
Creates a new ContainerBlueprint
from the given [egui_tiles::Container
].
This ContainerBlueprint
is ephemeral. If you want to make it permanent you
must call Self::save_to_blueprint_store
.
sourcepub fn missing_name_placeholder(&self) -> String
pub fn missing_name_placeholder(&self) -> String
Placeholder name displayed in the UI if the user hasn’t explicitly named the space view.
sourcepub fn display_name_or_default(&self) -> ContentsName
pub fn display_name_or_default(&self) -> ContentsName
Returns this container’s display name
When returning ContentsName::Placeholder
, the UI should display the resulting name using
re_ui::LabelStyle::Unnamed
.
sourcepub fn set_display_name(&self, ctx: &ViewerContext<'_>, name: Option<String>)
pub fn set_display_name(&self, ctx: &ViewerContext<'_>, name: Option<String>)
Sets the display name for this container.
pub fn set_visible(&self, ctx: &ViewerContext<'_>, visible: bool)
pub fn set_grid_columns( &self, ctx: &ViewerContext<'_>, grid_columns: Option<u32> )
sourcepub fn clear(&self, ctx: &ViewerContext<'_>)
pub fn clear(&self, ctx: &ViewerContext<'_>)
Clears the blueprint component for this container.
pub fn to_tile(&self) -> Tile<SpaceViewId>
Trait Implementations§
source§impl Debug for ContainerBlueprint
impl Debug for ContainerBlueprint
Auto Trait Implementations§
impl Freeze for ContainerBlueprint
impl RefUnwindSafe for ContainerBlueprint
impl Send for ContainerBlueprint
impl Sync for ContainerBlueprint
impl Unpin for ContainerBlueprint
impl UnwindSafe for ContainerBlueprint
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