pub struct TabSet<K: Clone + PartialEq + 'static> { /* private fields */ }Expand description
Ordered document identities and the selected document. Own this above the tab host. Payloads (editor buffers, browser profiles, etc.) remain application-owned.
Implementations§
Source§impl<K: Clone + PartialEq + 'static> TabSet<K>
impl<K: Clone + PartialEq + 'static> TabSet<K>
pub fn new() -> Self
pub fn keys(self) -> Vec<K>
pub fn selected(self) -> Option<K>
pub fn contains(self, key: &K) -> bool
Sourcepub fn open(self, key: K, foreground: bool)
pub fn open(self, key: K, foreground: bool)
Add a document once. Background insertion preserves the current selection.
pub fn select(self, key: &K) -> bool
Sourcepub fn close(self, key: &K) -> bool
pub fn close(self, key: &K) -> bool
Remove after the app accepts a close request. Prefer the following neighbor, or the preceding one when closing the last tab. Closing the final tab selects None.
Sourcepub fn move_to(self, key: &K, index: usize) -> bool
pub fn move_to(self, key: &K, index: usize) -> bool
Move a document to its final index, preserving selected identity.
pub fn select_next(self, backwards: bool)
Trait Implementations§
impl<K: Clone + PartialEq + 'static> Copy for TabSet<K>
Auto Trait Implementations§
impl<K> !Send for TabSet<K>
impl<K> !Sync for TabSet<K>
impl<K> Freeze for TabSet<K>
impl<K> RefUnwindSafe for TabSet<K>where
K: RefUnwindSafe,
impl<K> Unpin for TabSet<K>
impl<K> UnsafeUnpin for TabSet<K>
impl<K> UnwindSafe for TabSet<K>where
K: RefUnwindSafe,
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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