pub struct RichTextColumn<M, T> { /* private fields */ }Expand description
A column of a String field holding a rich text field’s HTML. A
detail page shows the formatted HTML; a table cell shows its text, cut to
excerpt characters; an export holds the text.
tablo_core::RichTextColumn::new(tablo_core::lens!(Post.body));The HTML is cleaned again as it renders, keeping what any Tool produces, since
a seed, a migration or another app can write the column without the field’s cleaning.
Implementations§
Source§impl<M, T> RichTextColumn<M, T>where
M: Model,
impl<M, T> RichTextColumn<M, T>where
M: Model,
Sourcepub fn new(lens: Lens<M, T>) -> RichTextColumn<M, T>where
T: Field<Inner = String>,
pub fn new(lens: Lens<M, T>) -> RichTextColumn<M, T>where
T: Field<Inner = String>,
Bind the column to the String or Option<String> field lens reads.
Sourcepub fn excerpt(self, chars: usize) -> RichTextColumn<M, T>
pub fn excerpt(self, chars: usize) -> RichTextColumn<M, T>
The most characters of text a table cell shows, followed by … when the text runs on;
120 by default.
Sourcepub fn label(self, label: impl Into<Text>) -> RichTextColumn<M, T>
pub fn label(self, label: impl Into<Text>) -> RichTextColumn<M, T>
Replace the label the field’s name gives it.
Sourcepub fn width(self, width: ColumnWidth) -> RichTextColumn<M, T>
pub fn width(self, width: ColumnWidth) -> RichTextColumn<M, T>
Declare this column’s width.
Sourcepub fn toggleable(self) -> RichTextColumn<M, T>
pub fn toggleable(self) -> RichTextColumn<M, T>
Let each reader hide this column from their list; it starts shown.
Let each reader show this column in their list; it starts hidden.
Trait Implementations§
Source§impl<M, T> Clone for RichTextColumn<M, T>
impl<M, T> Clone for RichTextColumn<M, T>
Source§fn clone(&self) -> RichTextColumn<M, T>
fn clone(&self) -> RichTextColumn<M, T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<M, T> Column<M> for RichTextColumn<M, T>
impl<M, T> Column<M> for RichTextColumn<M, T>
Source§fn column_width(&self) -> ColumnWidth
fn column_width(&self) -> ColumnWidth
The width the column claims.
Source§fn toggle(&self) -> ColumnToggle
fn toggle(&self) -> ColumnToggle
Whether each reader may hide or show the column in their list, and how it starts. A
detail page shows every column.
Source§fn search_expr(&self, _term: &str) -> Option<Expr<bool>>
fn search_expr(&self, _term: &str) -> Option<Expr<bool>>
The predicate a search for
term adds, or None when the column does not join the table’s
search. A column that joins it answers Some for every non-empty, trimmed term.Source§impl<M, T> Debug for RichTextColumn<M, T>
impl<M, T> Debug for RichTextColumn<M, T>
Source§impl<M, T> IntoColumns<M> for RichTextColumn<M, T>where
RichTextColumn<M, T>: Column<M> + 'static,
impl<M, T> IntoColumns<M> for RichTextColumn<M, T>where
RichTextColumn<M, T>: Column<M> + 'static,
Source§impl<M, T> IntoDetail<M> for RichTextColumn<M, T>where
RichTextColumn<M, T>: Column<M> + 'static,
impl<M, T> IntoDetail<M> for RichTextColumn<M, T>where
RichTextColumn<M, T>: Column<M> + 'static,
fn into_detail(self) -> Detail<M>
Auto Trait Implementations§
impl<M, T> Freeze for RichTextColumn<M, T>
impl<M, T> RefUnwindSafe for RichTextColumn<M, T>where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<M, T> Send for RichTextColumn<M, T>
impl<M, T> Sync for RichTextColumn<M, T>
impl<M, T> Unpin for RichTextColumn<M, T>
impl<M, T> UnsafeUnpin for RichTextColumn<M, T>
impl<M, T> UnwindSafe for RichTextColumn<M, T>where
M: UnwindSafe,
T: UnwindSafe,
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