#[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
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()).
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.
InvalidSegment
A path segment the panel routes cannot be a literal URL segment.
Pick a plain segment such as blog-posts.
Fields
fault: SegmentFaultWhy it is refused.
PrefixOverlapsRuntime
The prefix overlaps Topcoat’s runtime endpoints.
Pick another prefix.
PrefixOverlapsPanel
The prefix overlaps another panel’s.
Give each panel a prefix of its own.
EndpointOutsideRuntime
A Panel::endpoint route outside Topcoat’s runtime endpoints.
Declare only shards and procedures; the panel’s prefix guards its other routes.
ServeDirWithoutCatchAll
A Panel::serve_dir pattern that does not end in a catch-all.
End it in {*file}: /uploads/{*file}.
ServeDirTwice
The panel serves the same directory pattern twice.
Drop the second serve_dir.
ServeDirTaken
Another panel already serves the directory pattern.
Serve it from one panel.
InvalidContentSecurityPolicy
A Panel::content_security_policy that is no valid header value: drop its line breaks.
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.
DuplicateSlug
A slug another resource or page already mounts at.
Give each a distinct slug.
DuplicateAction
Two actions share a NAME.
Rename one.
ActionInput
An action’s input cannot be served.
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.
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.
TraversalLens
A lens with more than one step where a single field of the model is needed.
Name one field of the model.
UnresolvedLens
A multi-step lens that resolves to no single column.
Step only through embedded structs, enum variant fields and #[document] fields.
Fields
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.
Tenancy
A resource’s tenancy that cannot scope its rows.
Fields
fault: TenancyFaultWhat is wrong.
FieldAccess
A field access that cannot hide its field everywhere the panel shows it.
Fields
fault: FieldAccessFaultWhat 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().
DuplicateColumn
Two table columns share a name.
Rename one.
DuplicateFilter
Two table filters share a name.
Rename one.
DottedFilterName
A table filter’s name holds a ., which its URL parameters reserve for a part:
f.<name>.<part>.
Rename it without the ..
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.
DuplicateField
Two schema fields share a name.
Bind each input to a distinct field.
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.
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.
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.
FieldRule
A text field’s declared length, bounds or pattern cannot work.
Fields
fault: FieldRuleFaultWhat 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.
UnplacedWatchedField
A condition watches a field the schema does not place.
Place the watched field in the same schema.
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.
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.
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.
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.
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.
UnplacedParentField
A dependent choice depends on a field the schema does not place.
Place that field in the same schema.
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 = ..)].
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.
FormClaimsTenantColumn
A tenant-scoped resource’s record form claims the tenant column.
Drop the field: the framework stamps the tenant.
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.
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.
EmptyChoice
A choice field with neither options nor a relationship.
Declare .options(..), .relationship::<R>(), or #[form(relationship = R)].
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.
UniqueWithoutIndex
A field marked unique over a column no unique index covers.
Add #[unique] to the model, or drop .unique().
OptionalUnique
A unique field whose non-nullable column stores one value for every empty submission.
Make the field required, or an Option.
CreateColumnsNameTenant
create_column names the tenant column.
Drop it: the framework stamps the tenant.
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.
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.
Trait Implementations§
Source§impl Clone for DeclarationErrorKind
impl Clone for DeclarationErrorKind
Source§impl Debug for DeclarationErrorKind
impl Debug for DeclarationErrorKind
Source§impl Display for DeclarationErrorKind
impl Display for DeclarationErrorKind
impl Eq for DeclarationErrorKind
Source§impl PartialEq for DeclarationErrorKind
impl PartialEq for DeclarationErrorKind
impl StructuralPartialEq for DeclarationErrorKind
Auto Trait Implementations§
impl Freeze for DeclarationErrorKind
impl RefUnwindSafe for DeclarationErrorKind
impl Send for DeclarationErrorKind
impl Sync for DeclarationErrorKind
impl Unpin for DeclarationErrorKind
impl UnsafeUnpin for DeclarationErrorKind
impl UnwindSafe for DeclarationErrorKind
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> CloneAny for 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.