pub enum FieldRole {
Id,
Timestamp,
Bool,
NumericCount,
ForeignKey,
Status,
Email,
Phone,
PlainText,
}Expand description
The role a field plays in the admin UI. One field maps to exactly
one role; the ordering of branches in classify_field resolves
overlaps (e.g. an email column is FieldRole::Email, not
FieldRole::PlainText).
Variants§
Id
Primary key. Rendered monospace, excluded from edit forms.
Timestamp
DateTime<Utc>-shaped columns.
Bool
Booleans — rendered as a pill on the list page, a checkbox in forms.
NumericCount
Numeric values that aren’t identifiers.
ForeignKey
<something>_id integer column that points at another model.
Status
A status / *_status column.
An email address. Masked by default on list views.
Phone
A phone number. Masked by default.
PlainText
Everything else.
Implementations§
Trait Implementations§
impl Copy for FieldRole
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
Mutably borrows from an owned value. Read more
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
Compare self to
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>
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