pub struct ListFilter {
pub field: String,
pub label: Text,
pub filter_type: String,
pub options: Value,
pub default_value: Option<String>,
pub permission: Option<String>,
}Expand description
One filter offered above a list: a column, its label, and what it offers.
Fields§
§field: String§label: TextThe control’s label, localized at render.
filter_type: StringWhat the filter offers: boolean, select, text, number or date.
options: ValuePer-type options. A select carries its choices here; the rest none.
default_value: Option<String>Applied when the request names no value for this filter at all, so a screen can open already narrowed. Clearing it is still “no filter”.
permission: Option<String>A permission the operator must hold to see this filter, and to have its default applied.
Implementations§
Source§impl ListFilter
impl ListFilter
Sourcepub fn of(field: &str, label: impl Into<Text>, filter_type: &str) -> Self
pub fn of(field: &str, label: impl Into<Text>, filter_type: &str) -> Self
A filter of any declared type, with no options.
Sourcepub fn boolean(field: &str, label: impl Into<Text>) -> Self
pub fn boolean(field: &str, label: impl Into<Text>) -> Self
A yes/no filter over a boolean column.
Sourcepub fn select(
field: &str,
label: impl Into<Text>,
options: Vec<FilterOption>,
) -> Self
pub fn select( field: &str, label: impl Into<Text>, options: Vec<FilterOption>, ) -> Self
A filter offering a fixed set of values. Only a declared one reaches the query.
Sourcepub fn text(field: &str, label: impl Into<Text>) -> Self
pub fn text(field: &str, label: impl Into<Text>) -> Self
A substring match, folded the way the search box folds.
Sourcepub fn date(field: &str, label: impl Into<Text>) -> Self
pub fn date(field: &str, label: impl Into<Text>) -> Self
Rows on one calendar day, whether the column stores a date or a timestamp.
Sourcepub fn default_value(self, value: impl Into<String>) -> Self
pub fn default_value(self, value: impl Into<String>) -> Self
The value to apply when the request names none.
Trait Implementations§
Source§impl Clone for ListFilter
impl Clone for ListFilter
Source§impl Debug for ListFilter
impl Debug for ListFilter
Auto Trait Implementations§
impl Freeze for ListFilter
impl RefUnwindSafe for ListFilter
impl Send for ListFilter
impl Sync for ListFilter
impl Unpin for ListFilter
impl UnsafeUnpin for ListFilter
impl UnwindSafe for ListFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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