pub struct ColumnDef<'a, T: TreeModel> { /* private fields */ }Expand description
A column definition. Exactly one column in a set must have the tree role.
Implementations§
Source§impl<'a, T: TreeModel> ColumnDef<'a, T>
impl<'a, T: TreeModel> ColumnDef<'a, T>
Sourcepub fn tree(header: impl Into<Line<'a>>, width: ColumnWidth) -> Self
pub fn tree(header: impl Into<Line<'a>>, width: ColumnWidth) -> Self
Creates the primary tree column.
Sourcepub fn data<R>(
header: impl Into<Line<'a>>,
width: ColumnWidth,
renderer: R,
) -> Selfwhere
R: TreeCellRenderer<T> + 'a,
pub fn data<R>(
header: impl Into<Line<'a>>,
width: ColumnWidth,
renderer: R,
) -> Selfwhere
R: TreeCellRenderer<T> + 'a,
Creates an additional column whose renderer may borrow model data without allocation.
Function items and custom TreeCellRenderer implementations can return cells tied to
the model borrow. Use Self::data_owned for an ergonomic capturing closure.
Sourcepub fn data_owned<R>(
header: impl Into<Line<'a>>,
width: ColumnWidth,
renderer: R,
) -> Self
pub fn data_owned<R>( header: impl Into<Line<'a>>, width: ColumnWidth, renderer: R, ) -> Self
Creates an additional column from a capturing closure that returns an owned cell.
Use Self::data when the returned cell borrows model data. This variant is convenient
for closures that capture formatting configuration and produce owned text.
Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for ColumnDef<'a, T>
impl<'a, T> !Send for ColumnDef<'a, T>
impl<'a, T> !Sync for ColumnDef<'a, T>
impl<'a, T> !UnwindSafe for ColumnDef<'a, T>
impl<'a, T> Freeze for ColumnDef<'a, T>
impl<'a, T> Unpin for ColumnDef<'a, T>
impl<'a, T> UnsafeUnpin for ColumnDef<'a, T>
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> 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 more