pub struct Tabs {
pub children: Vec<TileId>,
pub active: Option<TileId>,
}Expand description
A container with tabs. Only one tab is open (active) at a time.
Fields§
§children: Vec<TileId>The tabs, in order.
active: Option<TileId>The currently open tab.
Implementations§
Source§impl Tabs
impl Tabs
pub fn new(children: Vec<TileId>) -> Self
pub fn add_child(&mut self, child: TileId)
pub fn set_active(&mut self, child: TileId)
pub fn is_active(&self, child: TileId) -> bool
Sourcepub fn ensure_active<Pane>(&mut self, tiles: &Tiles<Pane>)
pub fn ensure_active<Pane>(&mut self, tiles: &Tiles<Pane>)
Make sure we have an active tab (or no visible tabs).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tabs
impl<'de> Deserialize<'de> for Tabs
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
impl Eq for Tabs
impl StructuralPartialEq for Tabs
Auto Trait Implementations§
impl Freeze for Tabs
impl RefUnwindSafe for Tabs
impl Send for Tabs
impl Sync for Tabs
impl Unpin for Tabs
impl UnwindSafe for Tabs
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more