pub struct Filter<M: Model> { /* private fields */ }Expand description
A filter the user can apply to a resource’s table, shown as a chip above it.
Implementations§
Source§impl<M: Model> Filter<M>
impl<M: Model> Filter<M>
Sourcepub fn select(name: impl Into<String>) -> SelectFilterBuilder<M>
pub fn select(name: impl Into<String>) -> SelectFilterBuilder<M>
A filter that offers a list of choices, and keeps the records whose column equals the chosen one.
The filter compares the column with the choice’s value as text, which suits a column that
holds text, such as an enum. For another kind of column, such as an integer key, compare
it yourself with query.
Sourcepub fn boolean(name: impl Into<String>) -> Self
pub fn boolean(name: impl Into<String>) -> Self
A filter for a bool column, with a choice for true and one for false.
Sourcepub fn date_range(name: impl Into<String>) -> Self
pub fn date_range(name: impl Into<String>) -> Self
A filter for a date or timestamp column that keeps the records from one date through another. The user may leave either end open. A timestamp is compared by its date in UTC.
Sourcepub fn text(name: impl Into<String>) -> Self
pub fn text(name: impl Into<String>) -> Self
A filter that keeps the records whose column contains the text the user types.
Sourcepub fn label(self, label: impl Into<String>) -> Self
pub fn label(self, label: impl Into<String>) -> Self
Sets the filter’s label. By default it’s the filter’s name in words.
Trait Implementations§
Source§impl<M: Model> From<SelectFilterBuilder<M>> for Filter<M>
impl<M: Model> From<SelectFilterBuilder<M>> for Filter<M>
Source§fn from(builder: SelectFilterBuilder<M>) -> Self
fn from(builder: SelectFilterBuilder<M>) -> Self
Auto Trait Implementations§
impl<M> !RefUnwindSafe for Filter<M>
impl<M> !UnwindSafe for Filter<M>
impl<M> Forget for Filter<M>
impl<M> Freeze for Filter<M>
impl<M> Move for Filter<M>
impl<M> Send for Filter<M>
impl<M> Sync for Filter<M>
impl<M> Unpin for Filter<M>
impl<M> UnsafeUnpin for Filter<M>where
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<SelectOptionDto>: UnsafeUnpin,
*const ArcInner<dyn Fn(Builder<M>, &str) -> Builder<M> + Send + Sync> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn Fn(Builder<M>, &str) -> Builder<M> + Send + Sync>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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> ⓘ
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