pub struct Column {
pub key: SharedString,
pub name: SharedString,
pub align: TextAlign,
pub sort: Option<ColumnSort>,
pub paddings: Option<Edges<Pixels>>,
pub width: Pixels,
pub fixed: Option<ColumnFixed>,
pub resizable: bool,
pub movable: bool,
pub selectable: bool,
}
Expand description
Represents a column in a table, used for initializing table columns.
Fields§
§key: SharedString
§name: SharedString
§align: TextAlign
§sort: Option<ColumnSort>
§paddings: Option<Edges<Pixels>>
§width: Pixels
§fixed: Option<ColumnFixed>
§resizable: bool
§movable: bool
§selectable: bool
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(key: impl Into<SharedString>, name: impl Into<SharedString>) -> Self
pub fn new(key: impl Into<SharedString>, name: impl Into<SharedString>) -> Self
Create a new column with the given key and name.
Sourcepub fn sort(self, sort: ColumnSort) -> Self
pub fn sort(self, sort: ColumnSort) -> Self
Set the column to be sortable with custom sort function, default is None (not sortable).
See also Column::sortable
to enable sorting with default.
Sourcepub fn sortable(self) -> Self
pub fn sortable(self) -> Self
Set whether the column is sortable, default is true.
See also Column::sort
.
Sourcepub fn descending(self) -> Self
pub fn descending(self) -> Self
Set whether the column is sort with descending order.
Sourcepub fn text_right(self) -> Self
pub fn text_right(self) -> Self
Set the alignment of the column text, default is left.
Only text_left
, text_right
is supported.
Sourcepub fn paddings(self, paddings: impl Into<Edges<Pixels>>) -> Self
pub fn paddings(self, paddings: impl Into<Edges<Pixels>>) -> Self
Set the padding of the column, default is None.
pub fn p_0(self) -> Self
Sourcepub fn width(self, width: impl Into<Pixels>) -> Self
pub fn width(self, width: impl Into<Pixels>) -> Self
Set the width of the column, default is 100px.
Sourcepub fn fixed(self, fixed: impl Into<ColumnFixed>) -> Self
pub fn fixed(self, fixed: impl Into<ColumnFixed>) -> Self
Set whether the column is fixed, default is false.
Sourcepub fn fixed_left(self) -> Self
pub fn fixed_left(self) -> Self
Set whether the column is fixed on left side, default is false.
Sourcepub fn resizable(self, resizable: bool) -> Self
pub fn resizable(self, resizable: bool) -> Self
Set whether the column is resizable, default is true.
Sourcepub fn movable(self, movable: bool) -> Self
pub fn movable(self, movable: bool) -> Self
Set whether the column is movable, default is true.
Sourcepub fn selectable(self, selectable: bool) -> Self
pub fn selectable(self, selectable: bool) -> Self
Set whether the column is selectable, default is true.
Trait Implementations§
Source§impl FluentBuilder for Column
impl FluentBuilder for Column
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnwindSafe for Column
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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
.Source§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
.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.