Enum egui_tiles::Container
source · pub enum Container {
Tabs(Tabs),
Linear(Linear),
Grid(Grid),
}
Expand description
A container of several super::Tile
s.
Variants§
Implementations§
source§impl Container
impl Container
pub fn new(typ: ContainerKind, children: Vec<TileId>) -> Self
pub fn new_linear(dir: LinearDir, children: Vec<TileId>) -> Self
pub fn new_horizontal(children: Vec<TileId>) -> Self
pub fn new_vertical(children: Vec<TileId>) -> Self
pub fn new_tabs(children: Vec<TileId>) -> Self
pub fn new_grid(children: Vec<TileId>) -> Self
pub fn is_empty(&self) -> bool
pub fn num_children(&self) -> usize
pub fn children(&self) -> impl Iterator<Item = &TileId>
sourcepub fn only_child(&self) -> Option<TileId>
pub fn only_child(&self) -> Option<TileId>
If we have exactly one child, return it
pub fn children_vec(&self) -> Vec<TileId>
pub fn has_child(&self, needle: TileId) -> bool
pub fn add_child(&mut self, child: TileId)
sourcepub fn retain(&mut self, retain: impl FnMut(TileId) -> bool)
pub fn retain(&mut self, retain: impl FnMut(TileId) -> bool)
Iterate through all children in order, and keep only those for which the closure returns true
.
sourcepub fn remove_child(&mut self, child: TileId) -> Option<usize>
pub fn remove_child(&mut self, child: TileId) -> Option<usize>
Returns child index, if found.
pub fn kind(&self) -> ContainerKind
pub fn set_kind(&mut self, kind: ContainerKind)
Trait Implementations§
source§impl<'de> Deserialize<'de> for Container
impl<'de> Deserialize<'de> for Container
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq<Container> for Container
impl PartialEq<Container> for Container
impl StructuralPartialEq for Container
Auto Trait Implementations§
impl RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnwindSafe for Container
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
Mutably borrows from an owned value. Read more