Expand description
Resources defined at run time, from data: their slug, fields, columns and queries are values, not a Rust type, so an app can add and remove them while the panel serves.
A static resource implements IgniteResource and is added with
Ignite::resource. A runtime resource is a RuntimeResource value, whose rows come from
a RuntimeData the app implements, and is added with Registries::register_runtime. The panel
serves both through the same list, form and delete flows, at the same /admin/<slug>
address, and a slug can belong to only one of them.
ⓘ
register_runtime(
RuntimeResource::new("books", "Books", "Book", BookData)
.field(FieldDef { name: "title".into(), label: "Title".into(),
kind: FieldKindDef::Text, required: true })
.column(ColumnDef { key: "title".into(), label: "Title".into(),
sortable: true, searchable: true }),
)?;Structs§
- Block
Def - One block of a
FieldKindDef::FlexibleContentfield: the owned twin ofBlock. - Column
Def - One column of the list of a runtime resource: the owned twin of
Column. - Field
Def - One input on the form of a runtime resource: the owned twin of
Field. - Registered
Resource - A runtime resource as the registry holds it: the definition, ready for the panel.
- Runtime
Resource - A resource defined by data. Build it with
newand thefieldandcolumnmethods, then add it to the panel withRegistries::register_runtime.
Enums§
- Field
Kind Def - The kind of a
FieldDef: everyFieldKind, with owned values so it can be loaded from a database. - Redirect
After - Where the panel goes after a successful save of a runtime resource’s form, as Filament’s
getRedirectUrl()and the panel’sresourceCreatePageRedirect()andresourceEditPageRedirect(). SeeRuntimeResource::redirect_after_createandRuntimeResource::redirect_after_update. - Runtime
Error - Why the registry refused a change.
Constants§
- MAX_
FIELD_ NAME - The longest field name a runtime resource accepts, in bytes, as for a MySQL or MariaDB column name. The limit is a validation rule: names are owned by their resource and freed with it.
Traits§
- Runtime
Data - Where the rows of a runtime resource live. The app implements it, so Ignite assumes no
table layout: a custom post type can keep its rows in a shared
poststable and its values in a meta table.
Functions§
- register_
runtime - Registers
resourceon the default app, as 0.7.1 did. SeeRegistries::register_runtime. - reserve_
slugs - Reserves
slugson the default app, as 0.7.1 did. SeeRegistries::reserve_slugs. - runtime_
resource - The runtime resource at
slugon the default app. SeeRegistries::runtime_resource. - runtime_
resources - The runtime resources of the default app. See
Registries::runtime_resources. - unregister_
runtime - Removes the runtime resource at
slugfrom the default app. SeeRegistries::unregister_runtime. - validate_
fields_ for_ update - Turns a submitted form into a
Rowfor the fieldsfieldsthat are not a resource’s, such as the fields an app adds to the panel’s profile page, with the checks and the values ofRegisteredResource::validate_update: a blank password and a field the form did not send are left out of the row, an optional field sent blank isnull, and a checkbox the form did not send isfalse. Each error is keyed by its field’s name. A lookup’s value is not checked against its choices here: the panel checks it, as for a resource.
Type Aliases§
- Form
Notice - A line a record’s form shows, from its
FormContext, or none. - Form
Rule - A rule on a record’s form, given its
FormContext: the operation, the record, the user and the form’s values, as a Filament closure is given$recordand$operation. - Row
- One record of a runtime resource: its values by key, as JSON. A row the panel lists or
edits must have a numeric
id, and a key for each field and column it shows. - Runtime
Future - The future a
RuntimeDatamethod returns: boxed, so the trait can be a trait object. Write the body asBox::pin(async move { ... }).