Skip to main content

FieldRuleFault

Enum FieldRuleFault 

Source
#[non_exhaustive]
pub enum FieldRuleFault {
Show 20 variants UnorderedBound(String), InvalidPattern(String), EmptyRange, RefusedDefault(String), UnparsedDefault(String), NotText(&'static str), NotCheckbox, SingleValue, FewerOptions(usize), TagsOverRecords, AboveRowCap(usize), RefusedBlank, UnplacedComparedField(String), IncomparableField(String), UnorderedComparison(String), SelfComparison, NoExtension, InvalidExtension(String), SingleFile, AboveFormCap { max: usize, cap: usize, },
}
Expand description

Why a field’s declared rules cannot work: DeclarationErrorKind::FieldRule.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

UnorderedBound(String)

A min or max that is no value the field’s type parses, or a type without an order.

Bound a number, date, time or timestamp field by a value of its type.

§

InvalidPattern(String)

A pattern the server does not compile, with the compiler’s reason.

Fix the pattern.

§

EmptyRange

A min_length above the max_length, or a min above the max: no value passes.

Lower the minimum or raise the maximum.

§

RefusedDefault(String)

A default that breaks a rule, so a create that keeps it is refused.

Change the default or the rule.

§

UnparsedDefault(String)

A default the field’s type does not parse, as a timestamp spelled without an offset, so a create that keeps it is refused.

Spell the default as the type does, or pass a value of the type.

§

NotText(&'static str)

A rich text editor over a field whose type is no text, as a number or a timestamp, carrying the input type its text control had.

§

NotCheckbox

accepted on a control other than the built-in checkbox or switch.

§

SingleValue

min_items or max_items on a choice that is not multiple.

§

FewerOptions(usize)

A multiple choice’s min_items above the count of static options it offers, carried.

§

TagsOverRecords

tags on a relationship’s choice: a typed value names no record.

Drop tags, or offer static options as its suggestions.

§

AboveRowCap(usize)

A repeater’s max_items above MAX_REPEATER_ROWS, carried.

§

RefusedBlank

A field always disabled, with no default, whose blank answer breaks its own rules: an accepted checkbox or a min_items, so every create is refused.

§

UnplacedComparedField(String)

A comparison with a field the schema does not place, carried.

Place the compared field in the same schema, or in the same repeater row.

§

IncomparableField(String)

A comparison with a field that is no text field of the same type, carried.

Compare two fields of one type: an Option<T> field compares with a T one.

§

UnorderedComparison(String)

An ordering comparison over a type without an order, carrying the compared field.

Order a number, date, time or timestamp field, or compare with different.

§

SelfComparison

A comparison with the declaring field itself, so gt and lt refuse every value and the others none.

Compare with another field.

§

NoExtension

A file field’s extensions listing none, so it refuses every file.

List the extensions it takes, or drop extensions to take any.

§

InvalidExtension(String)

A file field’s extension that is not letters and digits, carried: tar.gz or *, which no file’s last extension is, as the rule reads only the last.

List the last extension alone: gz.

§

SingleFile

max_files on a file field over one path, from Field::file.

Bind a Vec<String> with Field::files, or drop max_files.

§

AboveFormCap

A file field’s max_bytes at or above the panel’s body cap, Limits::body_bytes: the body cap refuses a larger file first, so the rule never refuses one.

Lower max_bytes below the cap, or raise the cap.

Fields

§max: usize

The field’s max_bytes.

§cap: usize

The panel’s body cap.

Trait Implementations§

Source§

impl Clone for FieldRuleFault

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldRuleFault

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for FieldRuleFault

Source§

impl PartialEq for FieldRuleFault

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for FieldRuleFault

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AnyEq for T
where T: Any + PartialEq,

Source§

fn equals(&self, other: &(dyn Any + 'static)) -> bool

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more