pub enum FieldRole {
Primary,
Secondary,
Badge,
Timestamp,
DetailOnly,
Hidden,
}Expand description
How a field participates in the visual layout of a generated admin view.
The schema gives us names and types; it does not tell us what matters
visually. FieldRole is where that intent is recorded, once, in a
ViewSpec.
Variants§
Primary
The strongest field. Becomes the row title in list/card modes.
Secondary
Muted supporting information shown next to the primary.
Badge
Rendered as a pill/chip, usually an enum or status.
Timestamp
A date/time field, formatted consistently and kept visually quiet.
DetailOnly
Only shown on the detail page, never in list/table/card.
Hidden
Never rendered anywhere in the visible UI.
Implementations§
Source§impl FieldRole
impl FieldRole
Sourcepub fn shows_in_list(self) -> bool
pub fn shows_in_list(self) -> bool
Whether a field with this role should appear in list/table/card views.
Sourcepub fn reaches_template(self) -> bool
pub fn reaches_template(self) -> bool
Whether the field should reach the template context at all. Hidden
fields are stripped before rendering so they never leak into HTML.
Sourcepub fn slug(self) -> &'static str
pub fn slug(self) -> &'static str
The stable slug used in forms and serde, e.g. detail_only. Matches
the snake_case serde representation.
Trait Implementations§
impl Copy for FieldRole
Source§impl<'de> Deserialize<'de> for FieldRole
impl<'de> Deserialize<'de> for FieldRole
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for FieldRole
impl StructuralPartialEq for FieldRole
Auto Trait Implementations§
impl Freeze for FieldRole
impl RefUnwindSafe for FieldRole
impl Send for FieldRole
impl Sync for FieldRole
impl Unpin for FieldRole
impl UnsafeUnpin for FieldRole
impl UnwindSafe for FieldRole
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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>
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