pub enum TabAction<TabId> {
Pressed(TabId),
}Expand description
What happens when the user interacts with a tab.
Tab bars only emit one kind of event — a tab being pressed. We
still wrap it in an enum (rather than a bare TabId) so that
future extensions (close button on a tab, drag-to-reorder) can be
added without breaking the existing handler shape.
§Example
use snora_core::TabAction;
#[derive(Clone, Debug, PartialEq, Eq)]
enum WorkspaceTab { Library, Editor }
// Application code typically maps `TabAction` into its own message
// enum; here we just match on it directly.
let received: TabAction<WorkspaceTab> = TabAction::Pressed(WorkspaceTab::Editor);
match received {
TabAction::Pressed(id) => assert_eq!(id, WorkspaceTab::Editor),
}Variants§
Pressed(TabId)
The user pressed a tab. The application typically responds by
updating its active state and re-rendering.
Trait Implementations§
impl<TabId: Eq> Eq for TabAction<TabId>
impl<TabId: PartialEq> StructuralPartialEq for TabAction<TabId>
Auto Trait Implementations§
impl<TabId> Freeze for TabAction<TabId>where
TabId: Freeze,
impl<TabId> RefUnwindSafe for TabAction<TabId>where
TabId: RefUnwindSafe,
impl<TabId> Send for TabAction<TabId>where
TabId: Send,
impl<TabId> Sync for TabAction<TabId>where
TabId: Sync,
impl<TabId> Unpin for TabAction<TabId>where
TabId: Unpin,
impl<TabId> UnsafeUnpin for TabAction<TabId>where
TabId: UnsafeUnpin,
impl<TabId> UnwindSafe for TabAction<TabId>where
TabId: UnwindSafe,
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