pub struct TernaryFilter<M> { /* private fields */ }Expand description
Ternary filter matching a bool field.
TernaryFilter::new(lens!(Post.featured)).labels("Featured", "Not featured");Implementations§
Source§impl<M> TernaryFilter<M>where
M: Model,
impl<M> TernaryFilter<M>where
M: Model,
Sourcepub fn new(lens: impl Into<Path<M, bool>>) -> TernaryFilter<M>
pub fn new(lens: impl Into<Path<M, bool>>) -> TernaryFilter<M>
Filter the bool field lens binds to true, false, or either.
Sourcepub fn label(self, label: impl Into<Text>) -> TernaryFilter<M>
pub fn label(self, label: impl Into<Text>) -> TernaryFilter<M>
The label the control renders, over the field’s.
Trait Implementations§
Source§impl<M> Clone for TernaryFilter<M>
impl<M> Clone for TernaryFilter<M>
Source§fn clone(&self) -> TernaryFilter<M>
fn clone(&self) -> TernaryFilter<M>
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<M> Debug for TernaryFilter<M>
impl<M> Debug for TernaryFilter<M>
Source§impl<M> Filter<M> for TernaryFilter<M>
impl<M> Filter<M> for TernaryFilter<M>
Source§fn is_noop_value(&self, value: &FilterValue) -> bool
fn is_noop_value(&self, value: &FilterValue) -> bool
The documented no-op value selecting no predicate.
Source§fn to_expr(&self, _cx: &Cx, value: &FilterValue) -> Option<Expr<bool>>
fn to_expr(&self, _cx: &Cx, value: &FilterValue) -> Option<Expr<bool>>
The predicate
value selects for the request cx, or None when it selects none. The
table warns about a value that selects none unless is_noop_value
accepts 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>>
The control in the table’s filter menu.
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,
The control in the filter menu once what it offers has loaded, such as rows a query
returns. The filter menu renders this one; it defaults to
control.impl<M> IntoFilters<M> for TernaryFilter<M>
Auto Trait Implementations§
impl<M> Freeze for TernaryFilter<M>
impl<M> RefUnwindSafe for TernaryFilter<M>where
M: RefUnwindSafe,
impl<M> Send for TernaryFilter<M>where
M: Send,
impl<M> Sync for TernaryFilter<M>where
M: Sync,
impl<M> Unpin for TernaryFilter<M>where
M: Unpin,
impl<M> UnsafeUnpin for TernaryFilter<M>
impl<M> UnwindSafe for TernaryFilter<M>where
M: 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