pub struct ColumnDef {
pub key: String,
pub label: String,
pub col_type: ColumnType,
pub sortable: bool,
pub filterable: bool,
pub width: Option<u32>,
pub alignment: Alignment,
pub conditional: Option<ConditionalRule>,
}Expand description
Definition for a single column in a TableData.
Fields§
§key: StringMachine-readable key (not displayed).
label: StringHuman-readable header label.
col_type: ColumnTypeSemantic data type (drives filter UI and sort comparator).
sortable: boolWhether the column can be sorted by clicking the header.
filterable: boolWhether a filter control appears for this column.
width: Option<u32>Optional fixed pixel width (otherwise auto-sized).
alignment: AlignmentText alignment inside cells.
conditional: Option<ConditionalRule>Optional conditional formatting rule.
Implementations§
Source§impl ColumnDef
impl ColumnDef
Sourcepub fn new(
key: impl Into<String>,
label: impl Into<String>,
col_type: ColumnType,
) -> ColumnDef
pub fn new( key: impl Into<String>, label: impl Into<String>, col_type: ColumnType, ) -> ColumnDef
Convenience constructor with sensible defaults (sortable, filterable, left-aligned).
Sourcepub fn conditional(self, rule: ConditionalRule) -> ColumnDef
pub fn conditional(self, rule: ConditionalRule) -> ColumnDef
Attach a conditional formatting rule (builder pattern).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ColumnDef
impl RefUnwindSafe for ColumnDef
impl Send for ColumnDef
impl Sync for ColumnDef
impl Unpin for ColumnDef
impl UnsafeUnpin for ColumnDef
impl UnwindSafe for ColumnDef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> SerializableKey for T
impl<T> SerializableKey for T
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.