Skip to main content

DeclarationErrorKind

Enum DeclarationErrorKind 

Source
#[non_exhaustive]
pub enum DeclarationErrorKind {
Show 72 variants MissingDb, MissingAuthModels { models: Vec<&'static str>, }, ShellAssetsWithoutBundle, NotificationsWithoutAuth, FileFieldWithoutUploader { field: String, }, InvalidSegment { item: &'static str, segment: String, fault: SegmentFault, }, PrefixOverlapsRuntime { prefix: String, }, PrefixOverlapsPanel { other: String, }, EndpointOutsideRuntime { path: String, }, ServeDirWithoutCatchAll { path: String, }, ServeDirTwice { path: String, }, ServeDirTaken { path: String, panel: String, }, InvalidContentSecurityPolicy { policy: String, }, SecondHome, DuplicateResource, DuplicatePage, NotMounted, ReservedSlug { slug: String, }, DuplicateSlug { slug: String, }, DuplicateAction { name: &'static str, }, ActionInput { action: &'static str, fault: ActionInputFault, }, SignUp(SignUpFault), Profile(ProfileFault), PasswordReset(ResetFault), EmailVerification(VerificationFault), TenantRegistration(TenantRegistrationFault), TenantProfile(TenantProfileFault), TwoFactor(TwoFactorFault), AuthMail(AuthMailFault), Locale(LocaleFault), DuplicateRelation, UnregisteredRelation, UnregisteredOptionSource { field: String, source: &'static str, }, UnregisteredLabelSource { column: String, source: &'static str, }, TraversalLens { steps: usize, }, UnresolvedLens { model: &'static str, steps: Vec<usize>, }, Uncompiled { model: &'static str, error: String, }, Tenancy { fault: TenancyFault, }, FieldAccess { fault: FieldAccessFault, }, NoColumns, ZeroPageSize, UnsortableDefaultSort { column: String, }, DuplicateColumn { name: String, }, DuplicateFilter { name: String, }, DottedFilterName { name: String, }, UnparsedFilterOption { filter: String, value: String, }, DuplicateField { name: String, }, DisabledWithoutValue { field: String, }, RepeaterLeafModifier { field: String, leaf: String, }, RepeaterPassword { field: String, leaf: String, }, FieldRule { field: String, fault: FieldRuleFault, }, UnpostedDefault { field: String, value: String, }, UnplacedWatchedField { field: String, }, HiddenWatchedField { field: String, }, UnpostedConditionValue { field: String, value: String, }, MisdeclaredDependentChoice { field: String, }, MultipleDependentChoice { field: String, }, ListedDependentChoice { field: String, }, UnplacedParentField { field: String, parent: String, }, RequiredConditionalField { field: String, }, MissingControl { field: String, key: String, }, FormClaimsTenantColumn { field: String, column: String, }, FormClaimsSoftDeleteColumn { field: String, column: String, }, ReservedFormField { field: String, }, EmptyChoice { field: String, }, CompositeKeyChoice { field: String, }, UniqueWithoutIndex { field: String, }, OptionalUnique { field: String, }, CreateColumnsNameTenant { column: String, }, UnwrittenColumn { column: String, }, ImportWithoutCreate, ManyToMany { field: String, fault: ManyToManyFault, },
}
Expand description

What is wrong with a declaration.

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.
§

MissingDb

The router holds no toasty::Db.

Call .app_context(db) before .panel(..).

§

MissingAuthModels

Auth is on, but the Db does not register the shipped models it needs: AuthSession, AdminUser for the shipped authenticator, ColumnPreference while a list has a toggleable column, AuthToken for a feature that mails links or two-factor sign-in, and AuthFactor for two-factor sign-in.

Build the Db from tablo::models!(..), add them to toasty::models!(..), or opt out with .auth(Auth::disabled()).

Fields

§models: Vec<&'static str>

The unregistered models.

§

ShellAssetsWithoutBundle

Panel::shell_assets is set, but the router has no asset bundle.

Call .assets(..) before .panel(..).

§

NotificationsWithoutAuth

Panel::notifications on Auth::disabled, which signs nobody in to notify.

§

FileFieldWithoutUploader

A form declares a file field, but the panel installs no Uploader to store its bytes.

Install one with Panel::uploads or Panel::uploads_dir.

Fields

§field: String

The file field’s name.

§

InvalidSegment

A path segment the panel routes cannot be a literal URL segment.

Pick a plain segment such as blog-posts.

Fields

§item: &'static str

What names the segment: panel prefix, ResourceDef::slug or PageDef::slug.

§segment: String

The refused segment.

§fault: SegmentFault

Why it is refused.

§

PrefixOverlapsRuntime

The prefix overlaps Topcoat’s runtime endpoints.

Pick another prefix.

Fields

§prefix: String

The panel’s prefix.

§

PrefixOverlapsPanel

The prefix overlaps another panel’s.

Give each panel a prefix of its own.

Fields

§other: String

The other panel’s prefix.

§

EndpointOutsideRuntime

A Panel::endpoint route outside Topcoat’s runtime endpoints.

Declare only shards and procedures; the panel’s prefix guards its other routes.

Fields

§path: String

The route’s path.

§

ServeDirWithoutCatchAll

A Panel::serve_dir pattern that does not end in a catch-all.

End it in {*file}: /uploads/{*file}.

Fields

§path: String

The pattern.

§

ServeDirTwice

The panel serves the same directory pattern twice.

Drop the second serve_dir.

Fields

§path: String

The pattern.

§

ServeDirTaken

Another panel already serves the directory pattern.

Serve it from one panel.

Fields

§path: String

The pattern.

§panel: String

The serving panel’s prefix.

§

InvalidContentSecurityPolicy

A Panel::content_security_policy that is no valid header value: drop its line breaks.

Fields

§policy: String

The policy.

§

SecondHome

A second Panel::home page.

Keep one home page; register the other with page.

§

DuplicateResource

The resource is registered on the panel twice.

Register it once; mount a variant under its own type.

§

DuplicatePage

The page is registered on the panel twice, Panel::home included.

Register it once; mount a variant under its own type.

§

NotMounted

The resource is not mounted on the context’s panel.

It refuses no mount: a request answers 500 when app code asks for a resource its panel does not register, through wired_table, scoped_query, write_create or write_update. Register the resource on that panel, or reach it through a context of a panel that does.

§

ReservedSlug

A slug naming a route the panel serves itself: login, logout, register, profile, forgot-password, reset-password or -.

Rename it with ResourceDef::slug or PageDef::slug.

Fields

§slug: String

The slug.

§

DuplicateSlug

A slug another resource or page already mounts at.

Give each a distinct slug.

Fields

§slug: String

The slug.

§

DuplicateAction

Two actions share a NAME.

Rename one.

Fields

§name: &'static str

The shared name.

§

ActionInput

An action’s input cannot be served.

Fields

§action: &'static str

The action’s NAME.

§fault: ActionInputFault

What is wrong with it.

§

SignUp(SignUpFault)

The panel’s sign-up page cannot be served.

§

Profile(ProfileFault)

The panel’s profile page cannot be served.

§

PasswordReset(ResetFault)

The panel’s password reset cannot be served.

§

EmailVerification(VerificationFault)

The panel’s email verification cannot be served.

§

TenantRegistration(TenantRegistrationFault)

The panel’s tenant registration page cannot be served.

§

TenantProfile(TenantProfileFault)

The panel’s tenant settings page cannot be served.

§

TwoFactor(TwoFactorFault)

The panel’s two-factor sign-in cannot be served.

§

AuthMail(AuthMailFault)

The panel’s auth mail cannot be sent.

§

Locale(LocaleFault)

The panel’s locales or translations cannot be served.

§

DuplicateRelation

Two relations to the same resource.

Keep one.

§

UnregisteredRelation

A relation to a resource the panel does not register.

Register the related resource.

§

UnregisteredOptionSource

A relationship field, or a relationship filter, whose options come from a resource the panel does not register.

Register that resource.

Fields

§field: String

The field.

§source: &'static str

The option source’s type.

§

UnregisteredLabelSource

A relation column labelling its records by a resource the panel does not register: RelationColumn::{new, of, list}::<R> or CountColumn::of::<R>.

Register R, or use RelationColumn::unscoped for a model no resource administers.

Fields

§column: String

The column.

§source: &'static str

The label source’s type.

§

TraversalLens

A lens with more than one step where a single field of the model is needed.

Name one field of the model.

Fields

§steps: usize

The lens’s step count.

§

UnresolvedLens

A multi-step lens that resolves to no single column.

Step only through embedded structs, enum variant fields and #[document] fields.

Fields

§model: &'static str

The lens’s model.

§steps: Vec<usize>

The lens’s field indices, step by step.

§

Uncompiled

A model whose schema no driver compiles, so its embedded paths name no column. The error gives the reason of each of Toasty’s PostgreSQL, SQLite, MySQL and DynamoDB drivers.

Fix the model for your driver.

Fields

§model: &'static str

The model.

§error: String

Each driver’s reason to refuse it.

§

Tenancy

A resource’s tenancy that cannot scope its rows.

Fields

§fault: TenancyFault

What is wrong.

§

FieldAccess

A field access that cannot hide its field everywhere the panel shows it.

Fields

§fault: FieldAccessFault

What is wrong.

§

NoColumns

A table with no column.

Declare columns; a resource whose model’s table lists nothing declares its own table.

§

ZeroPageSize

Table::paginate(0).

Pass a page size of at least 1.

§

UnsortableDefaultSort

Table::default_sort names no sortable column.

Declare its column .sortable().

Fields

§column: String

The named column.

§

DuplicateColumn

Two table columns share a name.

Rename one.

Fields

§name: String

The shared name.

§

DuplicateFilter

Two table filters share a name.

Rename one.

Fields

§name: String

The shared name.

§

DottedFilterName

A table filter’s name holds a ., which its URL parameters reserve for a part: f.<name>.<part>.

Rename it without the ..

Fields

§name: String

The name.

§

UnparsedFilterOption

A select filter option whose value the field’s type does not parse, so choosing it filters nothing.

Spell it as the field’s form value, or build the filter with SelectFilter::of.

Fields

§filter: String

The filter’s name.

§value: String

The option’s value.

§

DuplicateField

Two schema fields share a name.

Bind each input to a distinct field.

Fields

§name: String

The shared name.

§

DisabledWithoutValue

A field disabled on the create form, with no default and no blank answer: no create could fill it.

Give it a default, make it optional, or use disabled_on_edit.

Fields

§field: String

The disabled field.

§

RepeaterLeafModifier

A repeater’s item disables one of its row’s controls or gives it a default, which a row does not apply.

Disable the repeater’s own field.

Fields

§field: String

The repeater.

§leaf: String

The control in its row.

§

RepeaterPassword

A repeater’s item has a password control, which an edit cannot render back, so every save would overwrite the stored secret.

Keep the secret out of the repeater’s item.

Fields

§field: String

The repeater.

§leaf: String

The password control in its row.

§

FieldRule

A text field’s declared length, bounds or pattern cannot work.

Fields

§field: String

The field, or repeater.leaf for a control in a repeater’s rows.

§fault: FieldRuleFault

What is wrong.

§

UnpostedDefault

A field’s default is a value its control never posts: one its type does not parse, one not among a choice’s options, or a list or one value where the control posts the other.

Spell the default as the field’s form value, a list for a multiple choice.

Fields

§field: String

The field.

§value: String

The default, a list spelled ["a", "b"].

§

UnplacedWatchedField

A condition watches a field the schema does not place.

Place the watched field in the same schema.

Fields

§field: String

The watched field.

§

HiddenWatchedField

A condition watches a field that another condition hides while what it guards still shows.

Place the guarded field inside the block that hides the watched one.

Fields

§field: String

The watched field.

§

UnpostedConditionValue

A condition names a value its watched field never posts: not one of a choice’s options, or neither true nor false for a toggle.

Name one of its options, or true or false for a toggle.

Fields

§field: String

The watched field.

§value: String

The value.

§

MisdeclaredDependentChoice

A dependent choice’s column belongs to another model than its relationship’s source, or the choice has no relationship.

Declare relationship::<R>(), and name a column of R’s model in depends_on.

Fields

§field: String

The dependent choice.

§

MultipleDependentChoice

A dependent choice that takes several options, or that depends on one that does: a multiple choice’s key holds a list, which narrows nothing.

Drop depends_on or multiple.

Fields

§field: String

The dependent choice.

§

ListedDependentChoice

A dependent choice rendered as radios or buttons: the browser lists its options once, so it cannot narrow them when the parent changes.

Drop depends_on, or radio or buttons.

Fields

§field: String

The dependent choice.

§

UnplacedParentField

A dependent choice depends on a field the schema does not place.

Place that field in the same schema.

Fields

§field: String

The dependent choice.

§parent: String

The field it depends on.

§

RequiredConditionalField

A field a condition hides has no blank answer, so a submission hiding it cannot parse.

Make it an Option, or give it #[form(blank = ..)].

Fields

§field: String

The field.

§

MissingControl

A record-form field binding a key no control posts, after the form renders every field it does not place: a hand-written RecordForm::control that renders no control for it.

Render the field’s control.

Fields

§field: String

The record-form field.

§key: String

The key it binds.

§

FormClaimsTenantColumn

A tenant-scoped resource’s record form claims the tenant column.

Drop the field: the framework stamps the tenant.

Fields

§field: String

The record-form field.

§column: String

The tenant column.

§

FormClaimsSoftDeleteColumn

A soft-deleting resource’s record form claims the soft-delete column, which only a delete and a restore write.

Drop the field, or mark it #[form(skip)] on a ModelForm: only a delete and a restore write the column.

Fields

§field: String

The record-form field.

§column: String

The soft-delete column.

§

ReservedFormField

A form field named after a key the form’s POST carries itself, such as the CSRF token or the edit form’s record_version.

Fields

§field: String

The field.

§

EmptyChoice

A choice field with neither options nor a relationship.

Declare .options(..), .relationship::<R>(), or #[form(relationship = R)].

Fields

§field: String

The field.

§

CompositeKeyChoice

A relationship field, or a relationship filter, over a model with a composite primary key.

Choose over a model with a single-column key.

Fields

§field: String

The field, or the filter’s name.

§

UniqueWithoutIndex

A field marked unique over a column no unique index covers.

Add #[unique] to the model, or drop .unique().

Fields

§field: String

The field.

§

OptionalUnique

A unique field whose non-nullable column stores one value for every empty submission.

Make the field required, or an Option.

Fields

§field: String

The field.

§

CreateColumnsNameTenant

create_column names the tenant column.

Drop it: the framework stamps the tenant.

Fields

§column: String

The tenant column.

§

UnwrittenColumn

A non-nullable column nothing writes on create, for a resource that serves a create page: not the form, not a Toasty #[default(..)], not the tenant stamp, not a create_column.

Add the field to the form, a default to the model, or a create_column; or make the resource edit_only.

Fields

§column: String

The column.

§

ImportWithoutCreate

importable on a resource that serves no create page: it has no record form, or is edit_only.

Drop importable, or serve the create page.

§

ManyToMany

A many-to-many field or relation whose join model cannot link records.

Fields

§field: String

The field, or the relation’s via field.

§fault: ManyToManyFault

What is wrong.

Trait Implementations§

Source§

impl Clone for DeclarationErrorKind

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 DeclarationErrorKind

Source§

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

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

impl Display for DeclarationErrorKind

Source§

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

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

impl Eq for DeclarationErrorKind

Source§

impl PartialEq for DeclarationErrorKind

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 DeclarationErrorKind

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> CloneAny for T
where T: Any + Clone,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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