pub struct ColumnSpec { /* private fields */ }Expand description
What a column is to its header: id, title, width policy and the user
gestures it allows — every part of a Column except how its cells are
built.
TableHeader takes a list of these, which is what
lets an application put the table header over rows it lays out itself.
A Column<T> carries one too and forwards its builders to it, so the
two declare a column with the same calls and the same defaults.
The id must be a stable, unique string: it is the key the sort, the filters, the width map and the column order use.
Implementations§
Source§impl ColumnSpec
impl ColumnSpec
Sourcepub fn new(id: impl Into<String>, title: impl Into<LocalizedString>) -> Self
pub fn new(id: impl Into<String>, title: impl Into<LocalizedString>) -> Self
A column with a stable id and a localized title. Defaults: a
Flex(1.0) width, resizable, reorderable, neither sortable nor
filterable, unpinned.
Sourcepub fn width(self, w: ColumnWidth) -> Self
pub fn width(self, w: ColumnWidth) -> Self
How the column’s width is resolved. Default Flex(1.0).
Sourcepub fn min_width(self, px: f32) -> Self
pub fn min_width(self, px: f32) -> Self
The narrowest the column resolves or resizes to. Default: the table
style’s MIN_COLUMN_WIDTH_DEFAULT.
Sourcepub fn max_width(self, px: f32) -> Self
pub fn max_width(self, px: f32) -> Self
The widest the column resolves or resizes to. Default: unbounded.
Sourcepub fn alignment(self, a: Alignment) -> Self
pub fn alignment(self, a: Alignment) -> Self
Horizontal alignment of the column’s content. Default Leading.
Sourcepub fn resizable(self, b: bool) -> Self
pub fn resizable(self, b: bool) -> Self
Whether the header’s divider grip resizes the column. Default true.
Sourcepub fn reorderable(self, b: bool) -> Self
pub fn reorderable(self, b: bool) -> Self
Whether the header cell can be dragged to reorder the column.
Default true.
Sourcepub fn sortable(self, b: bool) -> Self
pub fn sortable(self, b: bool) -> Self
Whether a click on the header cycles the sort. Default false.
Sourcepub fn filterable(self, b: bool) -> Self
pub fn filterable(self, b: bool) -> Self
Whether the header offers the filter popover. Default false.
Sourcepub fn pinned(self, side: PinnedSide) -> Self
pub fn pinned(self, side: PinnedSide) -> Self
Which side, if any, the column is pinned to. Default None.
Trait Implementations§
Source§impl Clone for ColumnSpec
impl Clone for ColumnSpec
Source§fn clone(&self) -> ColumnSpec
fn clone(&self) -> ColumnSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ColumnSpec
impl !Send for ColumnSpec
impl !Sync for ColumnSpec
impl !UnwindSafe for ColumnSpec
impl Freeze for ColumnSpec
impl Unpin for ColumnSpec
impl UnsafeUnpin for ColumnSpec
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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