pub struct ChoiceField(/* private fields */);Expand description
A choice field: Field::choice.
Implementations§
Source§impl ChoiceField
impl ChoiceField
Source§impl ChoiceField
impl ChoiceField
Sourcepub fn options(self, options: impl IntoOptions) -> Self
pub fn options(self, options: impl IntoOptions) -> Self
Static options: values that are their own label
(["draft", "published"]), (value, label) pairs, or a
#[derive(Options)] enum’s
options().
Sourcepub fn searchable(self) -> Self
pub fn searchable(self) -> Self
Filters options as the user types, fetching from the relationship past the option cap.
Sourcepub fn relationship<R>(
self,
label: impl Fn(&R::Model) -> String + Send + Sync + 'static,
) -> Selfwhere
R: OptionSource + 'static,
pub fn relationship<R>(
self,
label: impl Fn(&R::Model) -> String + Send + Sync + 'static,
) -> Selfwhere
R: OptionSource + 'static,
Loads options from a related source’s tenant-scoped query, each valued by its primary key
and labelled by label, degrading to type-to-search past the option cap.
Trait Implementations§
Source§impl From<ChoiceField> for Field
impl From<ChoiceField> for Field
Source§fn from(builder: ChoiceField) -> Field
fn from(builder: ChoiceField) -> Field
Converts to this type from the input type.
Source§impl IntoSchema for ChoiceField
impl IntoSchema for ChoiceField
fn into_schema(self) -> Schema
Auto Trait Implementations§
impl !RefUnwindSafe for ChoiceField
impl !UnwindSafe for ChoiceField
impl Freeze for ChoiceField
impl Send for ChoiceField
impl Sync for ChoiceField
impl Unpin for ChoiceField
impl UnsafeUnpin for ChoiceField
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