Skip to main content

Crate ignite_core

Crate ignite_core 

Source
Expand description

Engine, resource traits and the database context for Ignite.

A resource describes one table the admin panel manages: its form fields, its list columns, and the queries that list, find, create, update and delete its rows. The ignite-panel crate turns a set of resources into Rocket routes.

Re-exports§

pub use action::ActionAbility;
pub use action::ActionResult;
pub use action::BulkAction;
pub use action::RowAction;
pub use action::DEFAULT_CONFIRMATION;
pub use condition::FieldConditions;
pub use condition::FormContext;
pub use condition::Operation;
pub use editor::editor_script;
pub use editor::register_editor;
pub use field::Block;
pub use field::Column;
pub use field::Field;
pub use field::FieldKind;
pub use form::FieldErrors;
pub use form::FormInput;
pub use form::ValidationError;
pub use layout::ColumnSpan;
pub use layout::Component;
pub use layout::FormLayout;
pub use layout::Group;
pub use layout::Section;
pub use layout::Tabs;
pub use layout::Width;
pub use list::active_tab;
pub use list::BadgeColor;
pub use list::ColumnBadges;
pub use list::FilterCondition;
pub use list::ListFilter;
pub use list::Tab;
pub use media::media_library;
pub use media::register_media_library;
pub use media::MediaItem;
pub use media::MediaLibrary;
pub use password::hash_password;
pub use password::verify_password;
pub use policy::policy;
pub use policy::register_policy;
pub use policy::unregister_policy;
pub use policy::ActingUser;
pub use policy::Policy;
pub use policy::ResourceAction;
pub use query::escape_like;
pub use query::Direction;
pub use query::ListQuery;
pub use query::Page;
pub use registries::Registries;
pub use resource::navigation_parents;
pub use resource::table_name_is;
pub use resource::IgniteResource;
pub use runtime_resource::register_runtime;
pub use runtime_resource::reserve_slugs;
pub use runtime_resource::runtime_resource;
pub use runtime_resource::runtime_resources;
pub use runtime_resource::unregister_runtime;
pub use runtime_resource::validate_fields_for_update;
pub use runtime_resource::BlockDef;
pub use runtime_resource::ColumnDef;
pub use runtime_resource::FieldDef;
pub use runtime_resource::FieldKindDef;
pub use runtime_resource::FormNotice;
pub use runtime_resource::FormRule;
pub use runtime_resource::RedirectAfter;
pub use runtime_resource::RegisteredResource;
pub use runtime_resource::Row;
pub use runtime_resource::RuntimeData;
pub use runtime_resource::RuntimeError;
pub use runtime_resource::RuntimeFuture;
pub use runtime_resource::RuntimeResource;
pub use runtime_resource::MAX_FIELD_NAME;
pub use structure::RepeaterSettings;
pub use structure::Repeaters;
pub use widget::FormWidget;
pub use widget::LatestRecords;
pub use widget::ListWidget;
pub use widget::ListWidgetRow;
pub use widget::Stat;
pub use widget::StatWidget;
pub use widget::StatsOverviewWidget;

Modules§

action
Row actions, as Filament’s table actions ($table->recordActions([...])): buttons on each row of a resource’s list that open a URL or run a task on the record, such as Restore, Move to trash and Delete permanently.
condition
Fields that show only when a condition holds, as Filament’s visible(), hidden(), visibleOn(), hiddenOn() and live(), and fields shown but not editable, as its disabled() and disabledOn().
editor
The rich text editor of FieldKind::Wysiwyg fields.
field
Form fields and table columns, as the panel renders them.
form
Submitted form values and the per-field error messages.
layout
The layout of a resource’s form, as Filament’s layout components: a grid of columns, Sections that group fields under a heading, Groups that stack sections in one column, each with a column_span, and Tabs that show one Tab of fields at a time.
list
The list page’s tabs and column badges, as Filament’s getTabs() on a List page and badge() with color() on a text column.
media
The media library that Image, File and Gallery fields pick from.
password
Argon2 password hashes. The panel’s sign-in and the derived password fields both use these functions, so every stored password has the same format.
policy
Who is acting, and what they may do with each record: the signed-in user the panel passes to a resource’s queries, and the policies that decide each action for a user and a record.
query
What the list view asks for: the page, the search text, the sort and the active tab’s conditions.
registries
The registries of one Ignite app.
resource
The trait a table implements to be managed by the admin panel.
runtime_resource
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.
structure
Repeaters, groups and flexible content edited as sub-fields, as Filament’s Repeater, Fieldset and Builder: the settings of a repeater or flexible content (RepeaterSettings), the values a form sends for one (structured_input), and the add, delete and move buttons (apply_operation).
widget
Dashboard widgets: the stat cards and the latest-records tables a resource can show on the dashboard, and the panel’s own widgets.

Structs§

Database
The connection pool for one database. Clone-free: share it behind an Arc or in Rocket’s state.

Derive Macros§

IgniteResource
Derives IgniteResource for an Orbit model. See ignite_macros for the attributes. Writes impl ignite_core::IgniteResource for a struct that models a table.