pub struct AdminField {
pub name: &'static str,
pub ty: FieldType,
pub editable: bool,
pub nullable: bool,
pub relation: Option<AdminRelation>,
}Expand description
Metadata about one struct field, generated by #[derive(RustioAdmin)]
and consumed by the admin renderer + the schema exporter.
nullable tracks whether the source field is Option<T>. When true:
- the DB column is allowed to be
NULL; - the admin form accepts an empty value and stores it as
NULL; - the schema exports it as
"nullable": true.
relation carries compile-time relation metadata when the source
field is annotated with #[rustio(belongs_to = "...")]. None
means the field is a plain column; the admin renders it using the
ty rules. When Some, the crate::admin::relations registry
resolves and renders the foreign key.
Fields§
§name: &'static str§ty: FieldType§editable: bool§nullable: bool§relation: Option<AdminRelation>Trait Implementations§
Source§impl Clone for AdminField
impl Clone for AdminField
Source§fn clone(&self) -> AdminField
fn clone(&self) -> AdminField
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 Debug for AdminField
impl Debug for AdminField
impl Copy for AdminField
Auto Trait Implementations§
impl Freeze for AdminField
impl RefUnwindSafe for AdminField
impl Send for AdminField
impl Sync for AdminField
impl Unpin for AdminField
impl UnsafeUnpin for AdminField
impl UnwindSafe for AdminField
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<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