#[non_exhaustive]pub struct ListColumn {
pub field: String,
pub label: Text,
pub column_type: String,
pub options: Value,
pub sortable: bool,
pub invisible: bool,
pub width: Option<String>,
pub align: Option<Align>,
pub permission: Option<String>,
pub searchable: Option<bool>,
pub labels: Vec<ValueLabel>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.field: StringComes from the key this was written under, never from the body.
label: TextThe column header, localized at render. Serde stays a plain string.
column_type: StringThe column-type registry key (text, date, boolean, status_pill, …).
options: ValueThe keys that belong to the column’s type, as an object: in a file they are written on the column itself. Null when there are none.
sortable: boolWhether the header sorts. Off for a column whose order means nothing.
invisible: boolHidden until the operator picks it from the column chooser.
width: Option<String>A CSS width, 10% or 120px. None shares the remaining space.
align: Option<Align>§permission: Option<String>A permission the operator must hold to see the column at all: it is then not queried, sorted, searched, picked or exported for them.
searchable: Option<bool>Whether the list’s search box looks in this column. None follows the
column type: text columns are searched, the rest are not, because a
substring match on a boolean or a stored timestamp answers nonsense.
labels: Vec<ValueLabel>What a stored value reads as: login_success shown as “Signed in”. A
value with no label shows as stored.
Implementations§
Source§impl ListColumn
impl ListColumn
pub fn new(field: &str, label: impl Into<Text>) -> Self
Sourcepub fn labels(self, labels: Vec<ValueLabel>) -> Self
pub fn labels(self, labels: Vec<ValueLabel>) -> Self
What each stored value reads as. A value not listed shows as stored.
Sourcepub fn searchable(self, searchable: bool) -> Self
pub fn searchable(self, searchable: bool) -> Self
Overrides whether the search box looks in this column.
pub fn sortable(self, sortable: bool) -> Self
pub fn width(self, width: impl Into<String>) -> Self
pub fn align(self, align: Align) -> Self
Trait Implementations§
Source§impl Clone for ListColumn
impl Clone for ListColumn
Source§impl Debug for ListColumn
impl Debug for ListColumn
Source§impl Default for ListColumn
impl Default for ListColumn
Source§impl<'de> Deserialize<'de> for ListColumn
impl<'de> Deserialize<'de> for ListColumn
Source§fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error>
Auto Trait Implementations§
impl Freeze for ListColumn
impl RefUnwindSafe for ListColumn
impl Send for ListColumn
impl Sync for ListColumn
impl Unpin for ListColumn
impl UnsafeUnpin for ListColumn
impl UnwindSafe for ListColumn
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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