pub enum Widget {
Text(Editor),
Select(SelectWidget),
Amount(AmountWidget),
Date(DateWidget),
Splits(SplitsWidget),
}Expand description
The primary widget union — enum dispatch, no Box<dyn>, derives Debug.
Variants§
Implementations§
Source§impl Widget
impl Widget
Sourcepub fn value(&self) -> &str
pub fn value(&self) -> &str
The submittable string value of this widget.
Returns "" for Splits (rows validated separately via SplitsWidget::rows).
Sourcepub fn display(&self) -> String
pub fn display(&self) -> String
The display string for rendering (label for Select, buffer for others).
Sourcepub fn as_text_mut(&mut self) -> Option<&mut Editor>
pub fn as_text_mut(&mut self) -> Option<&mut Editor>
Mutable reference to the inner Editor for Text, Amount, and
Date variants. Returns None for Select and Splits.
Sourcepub fn kind(&self) -> WidgetKind
pub fn kind(&self) -> WidgetKind
Variant discriminant used for widget-first key routing decisions.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Widget
impl RefUnwindSafe for Widget
impl Send for Widget
impl Sync for Widget
impl Unpin for Widget
impl UnsafeUnpin for Widget
impl UnwindSafe for Widget
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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