Skip to main content

AdminRegistry

Trait AdminRegistry 

Source
pub trait AdminRegistry {
    // Required methods
    fn add_resource(&mut self, resource: Resource);
    fn add_permission(&mut self, permission: Permission);
    fn add_settings(&mut self, item: SettingsItem);
    fn add_picker_source(&mut self, source: PickerSourceReg);
    fn add_persister(&mut self, persister: PersisterReg);
    fn add_field_type(&mut self, field_type: FieldTypeReg);
    fn add_screen(&mut self, screen: ScreenReg);
    fn add_public_route(&mut self, route: PublicRouteReg);
    fn add_nav(&mut self, item: NavItem);
    fn add_resource_hook(&mut self, hook: ResourceHook);
}
Expand description

Typed contribution channels for the framework’s admin surfaces, as an extension trait over the generic laterite_core::Registry. A module contributes its admin screens, permissions, and settings from its register; a wrong-type contribution is a compile error, not one silently ignored. The generic add/items underneath remains for open, plugin-defined points.

Required Methods§

Source

fn add_resource(&mut self, resource: Resource)

Adds a list/form resource (an admin screen).

Source

fn add_permission(&mut self, permission: Permission)

Adds a permission, offered in the role editor.

Source

fn add_settings(&mut self, item: SettingsItem)

Adds a settings model.

Source

fn add_picker_source(&mut self, source: PickerSourceReg)

Adds a reference-picker source, callable by a picker field’s endpoints.

Source

fn add_persister(&mut self, persister: PersisterReg)

Adds a form persister, selectable by a form descriptor’s persist key.

Source

fn add_field_type(&mut self, field_type: FieldTypeReg)

Adds a field type, nameable by any form or settings descriptor.

Source

fn add_screen(&mut self, screen: ScreenReg)

Mounts a screen of this module’s own: any routes descriptors cannot express, inside the admin with its session, permission and error handling.

Source

fn add_public_route(&mut self, route: PublicRouteReg)

Mounts a route outside the admin, at a literal path: robots.txt, a sitemap, a feed, a webhook receiver.

Source

fn add_nav(&mut self, item: NavItem)

Adds a menu entry or section. See nav::NavItem.

Source

fn add_resource_hook(&mut self, hook: ResourceHook)

Changes another module’s resource before it mounts. See ResourceHook.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AdminRegistry for Registry

Source§

fn add_resource(&mut self, resource: Resource)

Source§

fn add_permission(&mut self, permission: Permission)

Source§

fn add_settings(&mut self, item: SettingsItem)

Source§

fn add_picker_source(&mut self, source: PickerSourceReg)

Source§

fn add_screen(&mut self, screen: ScreenReg)

Source§

fn add_public_route(&mut self, route: PublicRouteReg)

Source§

fn add_nav(&mut self, item: NavItem)

Source§

fn add_resource_hook(&mut self, hook: ResourceHook)

Source§

fn add_persister(&mut self, persister: PersisterReg)

Source§

fn add_field_type(&mut self, field_type: FieldTypeReg)

Implementors§