pub struct PresenceFilter<M> { /* private fields */ }Expand description
Presence filter matching an Option field by whether it holds a value: f.<name>=set or
f.<name>=empty.
Over an optional foreign key it lists the records with or without a related record, such as the posts with no author, without naming any related record.
PresenceFilter::new(lens!(Post.cover)).labels("With a cover", "Without a cover");Implementations§
Source§impl<M> PresenceFilter<M>
impl<M> PresenceFilter<M>
Sourcepub fn new<T>(lens: impl Into<Path<M, Option<T>>>) -> PresenceFilter<M>
pub fn new<T>(lens: impl Into<Path<M, Option<T>>>) -> PresenceFilter<M>
Filter the optional field lens binds by whether it holds a value.
Sourcepub fn label(self, label: impl Into<Text>) -> PresenceFilter<M>
pub fn label(self, label: impl Into<Text>) -> PresenceFilter<M>
The label the control renders, over the field’s.
Trait Implementations§
Source§impl<M> Clone for PresenceFilter<M>
impl<M> Clone for PresenceFilter<M>
Source§fn clone(&self) -> PresenceFilter<M>
fn clone(&self) -> PresenceFilter<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 PresenceFilter<M>
impl<M> Debug for PresenceFilter<M>
Source§impl<M> Filter<M> for PresenceFilter<M>
impl<M> Filter<M> for PresenceFilter<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 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 is_noop_value(&self, _value: &FilterValue) -> bool
fn is_noop_value(&self, _value: &FilterValue) -> bool
Whether
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,
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 PresenceFilter<M>
Auto Trait Implementations§
impl<M> !RefUnwindSafe for PresenceFilter<M>
impl<M> !UnwindSafe for PresenceFilter<M>
impl<M> Freeze for PresenceFilter<M>
impl<M> Send for PresenceFilter<M>
impl<M> Sync for PresenceFilter<M>
impl<M> Unpin for PresenceFilter<M>
impl<M> UnsafeUnpin for PresenceFilter<M>
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