pub struct RecordColumn { /* private fields */ }Expand description
One stable column in a RecordsTable.
Visible labels need not be unique. Events and row lookup always use the application-supplied column ID.
Implementations§
Source§impl RecordColumn
impl RecordColumn
Sourcepub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
pub fn new(id: impl Into<SharedString>, label: impl Into<SharedString>) -> Self
Creates a column with a stable application ID and visible label.
Sourcepub fn width_in_rems(self, width: f32) -> Self
pub fn width_in_rems(self, width: f32) -> Self
Sets the column width in multiples of the reader’s base type size.
The width resolves against the window’s rem at layout time and is
resolved again when the reader zooms, so a column sized for its text
keeps that proportion; a width set with RecordColumn::width does
not. Columns of one table may mix the two, and the later call wins.
Sourcepub fn fill(self, share: f32) -> Self
pub fn fill(self, share: f32) -> Self
Takes a share of the width left over once every column has the width it asked for.
The width set by RecordColumn::width is a floor rather than a
ceiling here: the surplus is added to it, so a column that fills can
never collapse and there is no separate minimum to remember. A column
with twice the share of another takes twice as much of the surplus.
The moment one column asks, it and its fellow askers divide the surplus and every other column keeps exactly what it asked for - which is how a table gets one exact column beside one that stretches.
let exact = RecordColumn::new("cost", "Unit cost").width(px(120.));
let stretches = RecordColumn::new("notes", "Notes").width(px(180.)).fill(1.);Sourcepub fn alignment(self, alignment: RecordColumnAlignment) -> Self
pub fn alignment(self, alignment: RecordColumnAlignment) -> Self
Sets the column’s horizontal content alignment.
Sourcepub fn description(self, description: impl Into<SharedString>) -> Self
pub fn description(self, description: impl Into<SharedString>) -> Self
Adds supplementary accessible column guidance.
Sourcepub fn is_sortable(&self) -> bool
pub fn is_sortable(&self) -> bool
Returns whether the column can request sorting.
Sourcepub fn configured_width(&self) -> Option<Pixels>
pub fn configured_width(&self) -> Option<Pixels>
Returns the explicitly configured logical column width, if any.
A width set with RecordColumn::width_in_rems has no pixel value
until a window resolves it, so it reads as None here.
Sourcepub fn column_alignment(&self) -> RecordColumnAlignment
pub fn column_alignment(&self) -> RecordColumnAlignment
Returns the horizontal content alignment.
Sourcepub fn accessible_description(&self) -> Option<&str>
pub fn accessible_description(&self) -> Option<&str>
Returns supplementary accessible guidance, if supplied.
Trait Implementations§
Source§impl Clone for RecordColumn
impl Clone for RecordColumn
Source§fn clone(&self) -> RecordColumn
fn clone(&self) -> RecordColumn
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RecordColumn
impl Debug for RecordColumn
Source§impl PartialEq for RecordColumn
impl PartialEq for RecordColumn
impl StructuralPartialEq for RecordColumn
Auto Trait Implementations§
impl Freeze for RecordColumn
impl RefUnwindSafe for RecordColumn
impl Send for RecordColumn
impl Sync for RecordColumn
impl Unpin for RecordColumn
impl UnsafeUnpin for RecordColumn
impl UnwindSafe for RecordColumn
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> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Span], returning an
Instrumented wrapper.§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 more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
Subscriber to this type, returning a
[WithDispatch] wrapper.