Skip to main content

ErrorPage

Struct ErrorPage 

Source
pub struct ErrorPage;
Expand description

The built-in Error page type. Hand-rolled (not #[derive(PageType)] — the derive emits ::rustango_cms:: paths that don’t resolve from inside this crate).

Trait Implementations§

Source§

impl Default for ErrorPage

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PageTypeHandler for ErrorPage

Source§

fn app_label(&self) -> &'static str

Logical app this handler belongs to (e.g. "cms_articles"). Lets multiple crates contribute page types without type_name collisions, and groups them in the admin.
Source§

fn type_name(&self) -> &'static str

Stable identifier — stored in cms_page_type.type_name. Must be globally unique across the process.
Source§

fn verbose_name(&self) -> &'static str

Human-readable label for the admin UI.
Source§

fn default_template(&self) -> &'static str

Default Tera template path the renderer should use. A page can override it per row via Page::template_override.
Source§

fn icon(&self) -> Option<&'static str>

Material-symbols icon name for the page-type picker tile. Defaults to None — picker renders a generic glyph. Authors set it via #[page_type(icon = "article")] on the #[derive(PageType)] struct, or by overriding this method on hand-rolled handlers.
Source§

fn description(&self) -> Option<&'static str>

One-line description shown under verbose_name in the page-type picker. Defaults to None. Authors set it via #[page_type(description = "…")].
Source§

fn is_leaf(&self) -> bool

Whether this type is a leaf — it accepts no child pages at all. Distinct from allowed_child_types() == [], which means “no restriction” (any type may be a child). Returning true is the first-class way to say “this page can’t have children” without the sentinel hack of whitelisting a non-existent child type. Enforced parent-side at create / move time.
Source§

fn widgets<'life0, 'life1, 'async_trait>( &'life0 self, pool: &'life1 Pool, page_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<Widget>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Rich-widget alternative to Self::extension_fields. Returns full crate::Widget instances so handlers can expose the entire 26-kind widget catalog (Date, DatetimeTz, Color, Range, Radio, Select, Checkboxes, MultiSelect, Custom, …) instead of being limited to the legacy six ExtensionFieldKind variants. Read more
Source§

fn load_extension<'life0, 'life1, 'async_trait>( &'life0 self, pool: &'life1 Pool, page_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Value, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the typed extension row for a given page id and return it as JSON for the renderer’s Tera context. Read more
Source§

fn save_extension<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, pool: &'life1 Pool, page_id: i64, form: &'life2 HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Persist the posted form values into this type’s extension table. Called by the admin’s page-edit POST handler after the canonical cms_page row has been saved. Upsert keyed on page_id is the standard pattern. Read more
Source§

fn allowed_parent_types(&self) -> &'static [&'static str]

Page types that are allowed as a parent for instances of this type. Empty slice = no restriction (the child-side guard).
Source§

fn allowed_child_types(&self) -> &'static [&'static str]

Page types that are allowed as direct children of instances of this type. Empty slice = no restriction (the parent-side guard). Symmetric with Self::allowed_parent_types: both sides must agree at create / move time.
Source§

fn is_creatable(&self) -> bool

Whether this type may be created from the admin “Add page” menu. Defaults to true; abstract / programmatically-only types should override to false.
Source§

fn feed_kind(&self) -> Option<&'static str>

Opt this page type in to a public RSS 2.0 / Atom 1.0 feed (powered by rustango::syndication). The returned slug is the URL path segment under /feed/<slug>/rss.xml + /feed/<slug>/atom.xml; pick something URL-friendly and distinct from other page types’ slugs. Read more
Source§

fn workflow_slug(&self) -> Option<&'static str>

Opt this page type in to a multi-step approval workflow. Returns the Workflow name of the workflow to apply to pages of this type, or None to leave them on the direct-publish path. Read more
Source§

fn view_restriction(&self) -> Option<TypeViewRestriction>

Gate every page of this type behind an access requirement — the per-type analogue of the per-page Privacy tab. Return None (the default) to leave the type public; return crate::view_restriction::TypeViewRestriction::login to require any authenticated member, or crate::view_restriction::TypeViewRestriction::permission to require one of a set of permission codenames (checked through the framework permission engine). Read more
Source§

fn view_mode(&self) -> PageViewMode

Which representation this type serves on its public URL. Read more
Source§

fn routes(&self) -> Vec<RouteSpec>

URL patterns this page type serves IN ADDITION to its canonical url_path. Read more
Source§

fn route_context<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page: &'life2 Page, _matched: &'life3 RouteMatch, ) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Handler-computed ctx injected when a routable pattern matched. Mirrors Self::public_context but receives the matched route’s name + named capture groups. Override to load route-specific data — the year’s posts when archive_year matched, the tagged posts when tag matched, etc. Read more
Source§

fn public_context<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page: &'life2 Page, ) -> Pin<Box<dyn Future<Output = Result<Map<String, Value>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Inject handler-computed values into the public render’s Tera context, for hand-rolled data — e.g. a HomePage that exposes a latest_posts list to its template without baking the query into the template layer. Read more
Source§

fn children_query<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, pool: &'life1 Pool, page: &'life2 Page, ) -> Pin<Box<dyn Future<Output = Result<Vec<Page>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Build the children ctx var the public renderer hands to the page template (by default the live children, newest first) — index-style pages (BlogIndexPage, ArchivePage, …) lean on this to surface only published rows in a meaningful order. Read more
Source§

fn extension_fields<'life0, 'life1, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<ExtensionField>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Describe the extension-row’s fields so the admin page-editor can render a form section for them. The default returns an empty list — types without an extension table get no extra inputs in the editor. Read more
Source§

fn snippet_m2m_relations(&self) -> Vec<(&'static str, &'static str)>

Declared Page↔Snippet many-to-many relations as (relation_name, snippet_type) pairs. Macro-generated from the struct-level #[page_type(snippet_m2m(name = "Type", …))] attribute; the default is none. The public renderer resolves each relation’s chosen rows into snippet_relations.<name> so templates can iterate the related snippets.
Source§

fn preview_extension<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, pool: &'life1 Pool, page_id: i64, form: &'life2 HashMap<String, String>, ) -> Pin<Box<dyn Future<Output = Result<Value, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Build a virtual extension Value from a posted form HashMap without touching the persisted row. Powers the “preview unsaved changes” iframe in the page editor — the renderer substitutes the result for Self::load_extension so the preview reflects the current form state. Read more
Source§

fn extra_tabs<'life0, 'life1, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<TabSpec>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Handler-contributed tabs appended to the page-editor’s tab strip after the built-in Content / Promote / Theme / Revisions ones. Each TabSpec carries a stable name (used in the URL hash + localStorage for “remember last active tab”), a label, an optional Material-symbols icon Read more
Source§

fn inline_panels(&self) -> Vec<InlinePanelSpec>

Inline panels — 1-N collections of sub-rows that the page editor renders as a sortable list of cards. Each InlinePanelSpec declares the panel’s stable name, the human label, the per-row fields, and optional cardinality bounds. Read more
Source§

fn load_inline_panel<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page_id: i64, _panel_name: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<Map<String, Value>>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch existing rows for panel_name keyed under page_id. Each returned serde_json::Map is one row; keys match the name of the InlinePanelSpec::fields entries. Read more
Source§

fn save_inline_panel<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page_id: i64, _panel_name: &'life2 str, _rows: &'life3 [Map<String, Value>], ) -> Pin<Box<dyn Future<Output = Result<(), ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Persist the posted rows for panel_name under page_id. The admin POST handler parses inline-panel form keys (inline__<panel_name>__<row_idx>__<field>) into row dicts and calls this with the full set; the handler is responsible for the upsert / delete-removed semantics. Sort order is the position in the rows slice. Read more
Source§

fn display_fields<'life0, 'life1, 'async_trait>( &'life0 self, _pool: &'life1 Pool, _page_id: i64, ) -> Pin<Box<dyn Future<Output = Result<Vec<DisplayField>, ExecError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Computed / display-only fields shown in an “At a glance” panel at the top of the page-edit form. Each entry is a pre-rendered HTML chip (the value is | safed into the template) authored by the handler from arbitrary data: row counts, word counts, derived flags, audit timestamps, linked-snippet previews, etc. Read more

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> 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<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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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