pub struct Head<'a> {
pub room: ColumnRoom<'a>,
pub sorted: Option<Sort>,
}Expand description
One column of a table: the room it asks the sizer for, and the order in force on it, if any.
The table’s own column input. The sizing half is
ColumnRoom, the record every host sizes a
table from, so a column drops at one declared width on every renderer; the
order in force is the one fact a heading draws that sizing does not need.
Whether the column offers to be reordered is ColumnRoom::caret: a caret
sits beside a heading that is sortable or is the one the table is ordered by.
Fields§
§room: ColumnRoom<'a>What the column asks of the sizer, and whether its heading has a caret.
sorted: Option<Sort>The order in force on this column, when the table is ordered by it.
Implementations§
Source§impl<'a> Head<'a>
impl<'a> Head<'a>
Sourcepub const fn new(heading: &'a str) -> Self
pub const fn new(heading: &'a str) -> Self
A text column under heading that fills and is essential, the defaults
ColumnRoom::new gives.
Sourcepub const fn name(&self) -> &'a str
pub const fn name(&self) -> &'a str
The heading, which is also the name a Cell fills the column by.
Sourcepub const fn min(self, ch: u16) -> Self
pub const fn min(self, ch: u16) -> Self
The same column, declaring the narrowest it may be before it drops.
Sourcepub const fn priority(self, priority: Priority) -> Self
pub const fn priority(self, priority: Priority) -> Self
The same column, worth this much when room runs out.
Sourcepub const fn kind(self, kind: ColumnKind) -> Self
pub const fn kind(self, kind: ColumnKind) -> Self
The same column, holding this kind of value.
Sourcepub const fn sortable(self, sortable: bool) -> Self
pub const fn sortable(self, sortable: bool) -> Self
The same column, reorderable by the user or not. A column the table is ordered by keeps its caret either way.
Sourcepub const fn sorted(self, sort: Sort) -> Self
pub const fn sorted(self, sort: Sort) -> Self
The same column, the one the table is ordered by, in this direction.
Sourcepub const fn floor(&self) -> u16
pub const fn floor(&self) -> u16
The narrowest this column is drawn, in ch. See ColumnRoom::floor.
Trait Implementations§
impl<'a> Copy for Head<'a>
impl<'a> Eq for Head<'a>
impl<'a> StructuralPartialEq for Head<'a>
Auto Trait Implementations§
impl<'a> Forget for Head<'a>
impl<'a> Freeze for Head<'a>
impl<'a> Move for Head<'a>
impl<'a> RefUnwindSafe for Head<'a>
impl<'a> Send for Head<'a>
impl<'a> Sync for Head<'a>
impl<'a> Unpin for Head<'a>
impl<'a> UnsafeUnpin for Head<'a>
impl<'a> UnwindSafe for Head<'a>
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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