pub struct BridgedField {
pub field: AdminField,
pub primary_key: bool,
pub searchable: bool,
pub filterable: bool,
pub sortable: bool,
pub readonly: bool,
pub widget: Option<&'static str>,
}Expand description
One column in its bridge form: the existing AdminField
(consumed verbatim by the admin UI) plus the column-level
flags AdminField doesn’t model.
Consumers:
- The admin renderer plucks
.fieldout forAdminEntry. - A search-index sync layer (commit 6) reads
.searchable. - Future filter/sort UI reads
.filterable/.sortable. - The
.primary_keybit identifies the row-id column for any code that needs it without re-scanning the schema.
Fields§
§field: AdminFieldThe existing-shape admin field. Plug this directly into
AdminEntry.fields (after Box::leak-ing the slice).
primary_key: booltrue when the source column has primary_key = true.
Mirrors ModelColumn.primary_key.
searchable: boolflags.searchable from the source column.
filterable: boolflags.filterable from the source column.
sortable: boolflags.sortable from the source column.
readonly: boolflags.readonly from the source column. Also drives
field.editable = !readonly.
widget: Option<&'static str>admin_widget from the source column, preserved
verbatim. AdminField doesn’t carry a widget override
today; the existing renderer derives the widget from
FieldType.widget(). Holding the override here lets
future renderer code consult it without altering
AdminField’s shape.
Implementations§
Source§impl BridgedField
impl BridgedField
Sourcepub fn effective_widget(&self) -> Option<&'static str>
pub fn effective_widget(&self) -> Option<&'static str>
Phase 15 / commit 9 polish — effective form widget.
Resolves to the first available answer:
- Explicit
admin_widgetfrom the source column. - Name-based inference:
email/*_email→"email";phone/tel/*_phone/*_tel→"tel";url/*_url/*_uri→"url";password/passwd/*_password→"password". None— the renderer falls back toFieldType.widget()(the existing default).
Inference is intentionally conservative: only column
names that are unambiguous matches return a hint,
to avoid e.g. a column called description getting
“url” because someone embedded a URL in their schema
docs.
Trait Implementations§
Source§impl Clone for BridgedField
impl Clone for BridgedField
Source§fn clone(&self) -> BridgedField
fn clone(&self) -> BridgedField
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BridgedField
impl RefUnwindSafe for BridgedField
impl Send for BridgedField
impl Sync for BridgedField
impl Unpin for BridgedField
impl UnsafeUnpin for BridgedField
impl UnwindSafe for BridgedField
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