pub enum FieldKind {
Show 27 variants
Text,
Textarea,
Password,
Number,
Decimal(&'static str),
Checkbox,
Select(&'static [(&'static str, &'static str)]),
Lookup,
Date,
DateTime,
Email,
Url,
Radio(&'static [(&'static str, &'static str)]),
Color,
Image,
File,
Link,
Wysiwyg,
PostObject,
Relationship,
Taxonomy,
User,
Repeater(&'static [Field]),
Group(&'static [Field]),
FlexibleContent(&'static [Block]),
Gallery,
Clone(&'static [Field]),
}Expand description
The kind of input a form field renders as, and how its value is read.
Variants§
Text
A single line of text.
Textarea
Several lines of text.
Password
A password. The form never shows the stored value.
Number
A whole number, submitted as text. A resource’s integer field is checked as a whole
number. A profile field accepts decimals as well (see Field::check_number).
Decimal(&'static str)
A decimal number, submitted as text, such as 9.5. The string is the browser’s
step for the input: "any" accepts every value, and "0.01" steps by cents.
Checkbox
A yes/no value. Read it with FormInput::checkbox.
Select(&'static [(&'static str, &'static str)])
One choice from a list of (value, label) pairs.
Lookup
One choice from options that the resource loads from the database each time its
form is shown, such as the rows of a related table. See
IgniteResource::options.
Date
A calendar date, as YYYY-MM-DD.
DateTime
A date and time, as YYYY-MM-DDTHH:MM, with seconds when given.
An email address, as Filament’s TextInput::make()->email(). The value must be a
valid address, as the browser’s type="email" input defines one (see
Field::check_email).
Url
A URL, as Filament’s TextInput::make()->url(). The value must parse as an absolute
URL (see Field::check_url).
Radio(&'static [(&'static str, &'static str)])
One choice from a list of (value, label) pairs, shown as radio buttons, as
Filament’s Radio. The value is checked as a Select is.
Color
A color, as Filament’s ColorPicker. The value is #rrggbb, stored in lowercase
(see Field::check_color).
Image
An image from the media library, as Filament’s FileUpload::make()->image(). The
value is the item’s id, a positive whole number, stored as text. The panel shows the
item through the app’s MediaLibrary, when one is registered.
File
A file from the media library, as Filament’s FileUpload. Stored as
Image is.
Link
A link (ACF’s link field): the JSON text {"url": ..., "title": ..., "target": ...}.
The URL is required and must parse; target is "" or "_blank" (see
Field::check_link).
Wysiwyg
Rich text, as Filament’s RichEditor. The panel renders a textarea marked with
data-ignite-editor, and loads the editor script the app registers with
register_editor. Ignite bundles no editor. The value is
the submitted HTML, unchanged.
PostObject
One post, chosen from options loaded each time the form is shown, as a
Lookup is (ACF’s post object field).
Relationship
Several choices from options loaded each time the form is shown (ACF’s relationship
field): the multi-value PostObject. The value is a JSON array
of the chosen option values, as strings, such as ["12","40"].
Taxonomy
One taxonomy term, chosen from loaded options, as a Lookup is.
User
One user, chosen from loaded options, as a Lookup is.
Repeater(&'static [Field])
Rows of the given sub-fields, as Filament’s Repeater. The value is a JSON array
with one object per row, keyed by sub-field name, such as
[{"title": "One"}, {"title": "Two"}]. Each row is checked against the sub-fields.
Group(&'static [Field])
The given sub-fields, kept together (ACF’s group field). The value is one JSON object keyed by sub-field name.
FlexibleContent(&'static [Block])
Rows that each take one of the given blocks, as Filament’s Builder. The value is a
JSON array of {"type": <block name>, "data": {<sub-field values>}} objects, as
Filament stores a builder.
Gallery
Several images from the media library (ACF’s gallery field). The value is a JSON
array of item ids, such as [3,8].
Clone(&'static [Field])
The fields of another field group, reused (ACF’s clone field). Ignite has no field
groups of its own: the app resolves the group it clones and passes its fields here.
The value is stored and checked as a Group of those fields is.
Implementations§
Source§impl FieldKind
impl FieldKind
Sourcepub fn loads_options(&self) -> bool
pub fn loads_options(&self) -> bool
Whether the field’s choices are loaded each time its form is shown, through
IgniteResource::options or
RuntimeData::options: a lookup, post object,
relationship, taxonomy or user field.
Trait Implementations§
impl Copy for FieldKind
impl Eq for FieldKind
Source§impl From<FieldKind> for FieldKindDef
impl From<FieldKind> for FieldKindDef
impl StructuralPartialEq for FieldKind
Auto Trait Implementations§
impl Forget for FieldKind
impl Freeze for FieldKind
impl Move for FieldKind
impl RefUnwindSafe for FieldKind
impl Send for FieldKind
impl Sync for FieldKind
impl Unpin for FieldKind
impl UnsafeUnpin for FieldKind
impl UnwindSafe for FieldKind
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