pub struct AdminUiField {
pub name: &'static str,
pub label: &'static str,
pub data_type: AdminDataType,
pub required: bool,
pub readonly: bool,
pub is_relation: bool,
pub options: Vec<(String, String)>,
pub filterable: bool,
pub advanced_filter: bool,
pub sortable: bool,
pub visible_in_table: bool,
}Fields§
§name: &'static str§label: &'static str§data_type: AdminDataType§required: bool§readonly: bool§is_relation: booltrue when the column points at another model (FK). Forces
the bridge to emit FieldType::ForeignKey regardless of
data_type — a <select> populated from options is the
only correct rendering.
options: Vec<(String, String)>(value, label) pairs supplied for FK / enum-like columns.
filterable: booltrue → field is rendered as a default filter in the
toolbar. The control type is decided by resolve_filter_type
from the field’s data_type / is_relation / options.
advanced_filter: booltrue → field is offered in the “+ Add filter” advanced
dropdown, not the always-visible toolbar. A field can set
neither (no filter), one, or both.
sortable: booltrue → table column header for this field becomes a
clickable sort link (?sort=<name>&dir=asc|desc). Fields
with sortable = false are silently rejected even if the
URL asks for them — metadata is the gate.
visible_in_table: booltrue → column appears in the listing table. false keeps
the field in the form / detail view but hides it from the
rows. Defaults to true for editable columns.
Implementations§
Source§impl AdminUiField
impl AdminUiField
pub fn text(name: &'static str, label: &'static str) -> Self
pub fn textarea(name: &'static str, label: &'static str) -> Self
pub fn integer(name: &'static str, label: &'static str) -> Self
pub fn float(name: &'static str, label: &'static str) -> Self
pub fn boolean(name: &'static str, label: &'static str) -> Self
pub fn datetime(name: &'static str, label: &'static str) -> Self
pub fn email(name: &'static str, label: &'static str) -> Self
pub fn required(self, value: bool) -> Self
pub fn readonly(self, value: bool) -> Self
pub fn relation(self, value: bool) -> Self
pub fn options(self, options: Vec<(String, String)>) -> Self
pub fn filterable(self, value: bool) -> Self
pub fn advanced_filter(self, value: bool) -> Self
pub fn sortable(self, value: bool) -> Self
pub fn visible_in_table(self, value: bool) -> Self
Trait Implementations§
Source§impl Clone for AdminUiField
impl Clone for AdminUiField
Source§fn clone(&self) -> AdminUiField
fn clone(&self) -> AdminUiField
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AdminUiField
impl RefUnwindSafe for AdminUiField
impl Send for AdminUiField
impl Sync for AdminUiField
impl Unpin for AdminUiField
impl UnsafeUnpin for AdminUiField
impl UnwindSafe for AdminUiField
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<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