pub struct NumericInputOpts<'a> {
pub min: Option<f64>,
pub max: Option<f64>,
pub step: f64,
pub decimals: Option<u8>,
pub placeholder: Option<&'a str>,
}Expand description
Configuration for numeric_input / apply_event.
Defaults: no min, no max, step = 1.0, no fixed precision, no
placeholder. The same value is expected to be available both at
build-time (for the placeholder) and at event-time (so spinner
clicks know how much to step and where to clamp), so this is a
struct the app holds onto rather than chained modifiers on the
returned El — the same pattern TextInputOpts uses.
Fields§
§min: Option<f64>Lower bound. Spinner clicks clamp to at least this value.
None means unbounded below.
max: Option<f64>Upper bound. Spinner clicks clamp to at most this value.
None means unbounded above.
step: f64Increment for one spinner click. Default 1.0.
decimals: Option<u8>Fixed decimal places for the formatted result.
None means: integral values render as 42, non-integral via
f64::Display. Some(n) always formats with n decimals
(e.g. Some(2) produces "3.50").
placeholder: Option<&'a str>Muted hint shown only while value is empty.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for NumericInputOpts<'a>
impl<'a> Clone for NumericInputOpts<'a>
Source§fn clone(&self) -> NumericInputOpts<'a>
fn clone(&self) -> NumericInputOpts<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for NumericInputOpts<'a>
impl<'a> Debug for NumericInputOpts<'a>
Source§impl Default for NumericInputOpts<'_>
impl Default for NumericInputOpts<'_>
impl<'a> Copy for NumericInputOpts<'a>
Auto Trait Implementations§
impl<'a> Freeze for NumericInputOpts<'a>
impl<'a> RefUnwindSafe for NumericInputOpts<'a>
impl<'a> Send for NumericInputOpts<'a>
impl<'a> Sync for NumericInputOpts<'a>
impl<'a> Unpin for NumericInputOpts<'a>
impl<'a> UnsafeUnpin for NumericInputOpts<'a>
impl<'a> UnwindSafe for NumericInputOpts<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.