pub struct NumberFilter<M> { /* private fields */ }Expand description
Number filter matching a number field exactly, or between two bounds; see FilterNumber
for the types.
A value names one number, f.<name>=42; on a range filter the parts
f.<name>.min and f.<name>.max bound it, both ends included, either one alone leaving it
open. A record whose optional field holds nothing matches no bound.
NumberFilter::new(lens!(Book.pages)).range();Implementations§
Source§impl<M> NumberFilter<M>
impl<M> NumberFilter<M>
Sourcepub fn new<T>(lens: impl Into<Path<M, T>>) -> NumberFilter<M>where
T: FilterNumber,
pub fn new<T>(lens: impl Into<Path<M, T>>) -> NumberFilter<M>where
T: FilterNumber,
Filter the number field lens binds to one value, or a range of values.
Sourcepub fn label(self, label: impl Into<Text>) -> NumberFilter<M>
pub fn label(self, label: impl Into<Text>) -> NumberFilter<M>
The label the control renders, over the field’s.
Sourcepub fn range(self) -> NumberFilter<M>
pub fn range(self) -> NumberFilter<M>
Choose a range: the control is two inputs, submitting the min and max parts.
Trait Implementations§
Source§impl<M> Clone for NumberFilter<M>
impl<M> Clone for NumberFilter<M>
Source§fn clone(&self) -> NumberFilter<M>
fn clone(&self) -> NumberFilter<M>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<M> Debug for NumberFilter<M>
impl<M> Debug for NumberFilter<M>
Source§impl<M> Filter<M> for NumberFilter<M>
impl<M> Filter<M> for NumberFilter<M>
Source§fn to_expr(&self, _cx: &Cx, value: &FilterValue) -> Option<Expr<bool>>
fn to_expr(&self, _cx: &Cx, value: &FilterValue) -> Option<Expr<bool>>
The exact value, or the range its min and max parts bound; None for a value the type
refuses, another part, a value beside the parts, a min above the max, or a part where
range is off, whose one input does not render it.
Source§fn control<'a>(&self, cx: &'a Cx, input: FilterInput) -> Pin<Box<dyn View + 'a>>
fn control<'a>(&self, cx: &'a Cx, input: FilterInput) -> Pin<Box<dyn View + 'a>>
A number input, or two for a range.
Source§fn is_noop_value(&self, _value: &FilterValue) -> bool
fn is_noop_value(&self, _value: &FilterValue) -> bool
value selects no predicate without being invalid.Source§fn load_control<'s, 'a>(
&'s self,
cx: &'a Cx,
input: FilterInput,
) -> Pin<Box<dyn Future<Output = Pin<Box<dyn View + 'a>>> + Send + 's>>where
'a: 's,
fn load_control<'s, 'a>(
&'s self,
cx: &'a Cx,
input: FilterInput,
) -> Pin<Box<dyn Future<Output = Pin<Box<dyn View + 'a>>> + Send + 's>>where
'a: 's,
control.