pub enum FieldRole {
Id,
Timestamp,
Bool,
NumericCount,
ForeignKey,
Status,
Personnummer,
Email,
Phone,
OpaqueIdentifier,
Money,
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 — priorities, scores, counts. Rendered with tabular numerics on the list page.
ForeignKey
<something>_id column that points at another model. Rendered
monospace, filter is a relation dropdown (deferred).
Status
A status / *_status column. Renders as a coloured pill and
becomes a dropdown filter.
Personnummer
A Swedish personal identity number under country=SE.
An email address under GDPR. Masked by default on list views.
Phone
A phone number under GDPR. Masked by default.
OpaqueIdentifier
An opaque healthcare identifier (patient_id, mrn, …)
under industry=healthcare.
Money
A monetary amount under industry=banking. Stored as integer
minor units.
PlainText
Everything else. Default role; triggers the plain-text input.
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
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
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<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