pub enum FocusTarget<O = ()> {
CanvasField(usize),
InternalCanvasField(usize),
Button(usize),
Section(usize),
SectionItem {
section: usize,
item: usize,
},
Overlay(O),
ModalItem(usize),
Custom(String),
}Expand description
A focusable element of a page.
O is the application-defined overlay type carried by
FocusTarget::Overlay — your own enum of the modal overlays your TUI has
(a command bar, a search palette, a sidebar, …). The crate provides no
overlay names; you define them. Apps that use no named overlays leave O
at its default ().
Variants§
CanvasField(usize)
InternalCanvasField(usize)
Button(usize)
Section(usize)
SectionItem
Overlay(O)
ModalItem(usize)
Focus on item N inside the currently open modal overlay. The crate
names no modal kinds: a dialog button, a picker row, or any other
in-modal item is just a ModalItem. The dialog feature layers its
button conventions on top of this.
Custom(String)
Implementations§
Source§impl<O> FocusTarget<O>
impl<O> FocusTarget<O>
Source§impl<O: Clone> FocusTarget<O>
impl<O: Clone> FocusTarget<O>
Sourcepub fn to_overlay(&self) -> Option<O>
pub fn to_overlay(&self) -> Option<O>
The overlay identity if this target is an Overlay.
Trait Implementations§
Source§impl<O: Clone> Clone for FocusTarget<O>
impl<O: Clone> Clone for FocusTarget<O>
Source§fn clone(&self) -> FocusTarget<O>
fn clone(&self) -> FocusTarget<O>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<O: Debug> Debug for FocusTarget<O>
impl<O: Debug> Debug for FocusTarget<O>
Source§impl<'de, O> Deserialize<'de> for FocusTarget<O>where
O: Deserialize<'de>,
impl<'de, O> Deserialize<'de> for FocusTarget<O>where
O: Deserialize<'de>,
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<O: Hash> Hash for FocusTarget<O>
impl<O: Hash> Hash for FocusTarget<O>
Source§impl<O: PartialEq> PartialEq for FocusTarget<O>
impl<O: PartialEq> PartialEq for FocusTarget<O>
Source§fn eq(&self, other: &FocusTarget<O>) -> bool
fn eq(&self, other: &FocusTarget<O>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<O> Serialize for FocusTarget<O>where
O: Serialize,
impl<O> Serialize for FocusTarget<O>where
O: Serialize,
impl<O: Eq> Eq for FocusTarget<O>
impl<O> StructuralPartialEq for FocusTarget<O>
Auto Trait Implementations§
impl<O> Freeze for FocusTarget<O>where
O: Freeze,
impl<O> RefUnwindSafe for FocusTarget<O>where
O: RefUnwindSafe,
impl<O> Send for FocusTarget<O>where
O: Send,
impl<O> Sync for FocusTarget<O>where
O: Sync,
impl<O> Unpin for FocusTarget<O>where
O: Unpin,
impl<O> UnsafeUnpin for FocusTarget<O>where
O: UnsafeUnpin,
impl<O> UnwindSafe for FocusTarget<O>where
O: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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