#[non_exhaustive]pub enum DeclarationErrorKind {
Show 89 variants
MissingDb,
MissingAuthModels {
models: Vec<&'static str>,
},
ShellAssetsWithoutBundle,
NotificationsWithoutAuth,
MissingAuditModel,
BrandColor {
value: String,
},
ExternalAuthFeature {
feature: &'static str,
},
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,
},
ContentSecurityPolicy(PolicyFault),
SecondHome,
NoRoot,
DuplicateResource,
DuplicatePage,
NotMounted,
ReservedSlug {
slug: String,
},
DuplicateSlug {
slug: String,
},
DuplicateAction {
name: &'static str,
},
DuplicateWidget {
name: String,
},
MisdeclaredPageFilter {
key: String,
},
EditableColumn {
column: String,
fault: EditableColumnFault,
},
ActionInput {
action: &'static str,
fault: ActionInputFault,
},
SignUp(SignUpFault),
Profile(ProfileFault),
Area(AreaFault),
PasswordReset(ResetFault),
EmailVerification(VerificationFault),
TenantRegistration(TenantRegistrationFault),
TenantProfile(TenantProfileFault),
TwoFactor(TwoFactorFault),
AuthMail(AuthMailFault),
Locale(LocaleFault),
DuplicateRelation,
UnregisteredRelation,
HasOneTab,
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,
},
DuplicateTab {
key: String,
},
DuplicateGrouping {
name: String,
},
DottedFilterName {
name: String,
},
UnparsedFilterOption {
filter: String,
value: String,
},
UnparsedTabOption {
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,
},
DisabledWatchedField {
field: String,
},
UnpostedConditionValue {
field: String,
value: String,
},
MisdeclaredDependentChoice {
field: String,
},
UnfilterableChoice {
field: String,
},
MultipleDependentChoice {
field: String,
},
ListedDependentChoice {
field: String,
},
UncreatableChoice {
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,
EmptyDetail,
RelatedForm(RelatedFormFault),
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 .with(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.
MissingAuditModel
Panel::audit_log over a Db that does not register AuditEntry, so every write would
fail to store its entry.
Build the Db from tablo::models!(..), or add AuditEntry to toasty::models!(..).
BrandColor
A Brand color that is no hex color or plain color function, which the panel’s stylesheet
would carry as it is.
Spell it #4f46e5 or oklch(0.55 0.2 260).
ExternalAuthFeature
Auth::external beside a feature that needs Tablo to own the account’s credentials.
Drop the feature: the host app signs its users in, and keeps their credentials.
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.
ContentSecurityPolicy(PolicyFault)
The panel’s content security policy cannot be served.
SecondHome
A second Panel::home page.
Keep one home page; register the other with page.
NoRoot
Every resource declares without_navigation and
the panel has no home page, so its root, where a sign-in lands, leads nowhere.
Show one resource in the sidebar, or register a page with Panel::home.
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.
DuplicateWidget
Two widgets of a page, or of a resource’s list, share a name.
Give one a distinct WidgetDef::name.
MisdeclaredPageFilter
A page’s filter shares its key with another, or its key is not a word
a query parameter carries: ASCII letters, digits, - and _.
Give each filter a distinct key of those characters.
EditableColumn
A column cannot edit its field in a table’s cell.
Fields
fault: EditableColumnFaultWhat is wrong with it.
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.
Area(AreaFault)
An area cannot hold a page auth serves.
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.
HasOneTab
A has_one relation declared as a tab: its form edits inside the record’s own form.
Drop Relation::tab.
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::page_size(0).
Pass a page size of at least 1.
UnsortableDefaultSort
Table::default_sort_by 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.
DuplicateTab
Two list tabs share a key.
Give each ListTab a distinct key.
DuplicateGrouping
A table offers two groupings by one field.
Declare each Table::group_by once.
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.
UnparsedTabOption
An option of Table::option_tabs whose value the field’s
type does not parse, so its tab admits no row.
Spell the option as the field’s form value.
DuplicateField
Two schema fields share a name.
Bind each input to a distinct field.
DisabledWithoutValue
A field disabled or hidden on the create form, or one a condition can disable, with no
default and no blank answer: a create could not 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.
DisabledWatchedField
A condition, or a dependent choice, watches a field a condition disables, which posts nothing while it is disabled: the browser would follow the value the user last chose, the server the stored one or the default.
Watch another field, or drop disabled_when from 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.
UnfilterableChoice
A choice whose options_where narrows no
relationship: declare relationship::<R>(), or drop options_where.
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.
UncreatableChoice
A creatable choice that is not a single select over a resource’s records: a multiple choice, radios or buttons, a dependent or filtered choice, a source that is not a resource, no relationship, or a choice in a repeater’s rows.
Drop creatable, or declare the choice as a single select with relationship::<R>() over
a resource R.
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: the CSRF token, the edit
form’s record_version, or the create form’s create_another.
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 turn the
create page off with without_page(ResourcePage::Create).
ImportWithoutCreate
importable on a resource that serves no create page:
it has no record form, or turns the page off with
without_page.
Drop importable, or serve the create page.
EmptyDetail
A detail listing no column on a resource that serves the view page.
Declare a detail or a table, or turn the page off with
without_page(ResourcePage::View).
RelatedForm(RelatedFormFault)
A has_one relation whose related form cannot render inside the owner’s form.
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 Forget for DeclarationErrorKind
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
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.