#[non_exhaustive]pub struct Entry { /* private fields */ }Expand description
One labelled value on a record’s view page. format is one of the
kit’s entry formats: date, datetime, since, money, number,
bool, color, image, markdown, or none for text.
use renox_admin::Entry;
let entries = vec![
Entry::text("name", "Name").copyable(),
Entry::new("status", "Status").labels([("live", "Live")]).badge(),
Entry::new("price", "Price").format("money"),
Entry::new("notes", "Notes").format("markdown").span_full(),
];Implementations§
Source§impl Entry
impl Entry
Sourcepub fn new(key: &str, label: &str) -> Self
pub fn new(key: &str, label: &str) -> Self
The record’s key, shown as text under label until format says
otherwise.
Sourcepub fn format(self, format: &str) -> Self
pub fn format(self, format: &str) -> Self
How the value is shown: date, datetime, since, money (an
amount in the smallest unit, like the grid’s money columns),
number, bool, color, image or markdown.
Sourcepub fn labels<V: Into<String>, L: Into<String>>(
self,
labels: impl IntoIterator<Item = (V, L)>,
) -> Self
pub fn labels<V: Into<String>, L: Into<String>>( self, labels: impl IntoIterator<Item = (V, L)>, ) -> Self
Names for values (("live", "Live")), as a select’s options.
Sourcepub fn from_column(column: &Column) -> Option<Self>
pub fn from_column(column: &Column) -> Option<Self>
The entry a grid column suggests: its key, its heading and a format
that fits its kind (None for custom columns, which only the page
can draw).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Entry
impl RefUnwindSafe for Entry
impl Send for Entry
impl Sync for Entry
impl Unpin for Entry
impl UnsafeUnpin for Entry
impl UnwindSafe for Entry
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
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<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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