pub struct Admin { /* private fields */ }Expand description
Builder for the admin. Register models with .model::<M>(), then
hand it to the router via register_admin_routes.
Implementations§
Source§impl Admin
impl Admin
Sourcepub fn new() -> Self
pub fn new() -> Self
Constructs a new Admin with the framework’s core entries
pre-seeded. As of Phase 2 the only core entry is User, which
the schema exporter must always describe so external tooling
can reason about authentication tables. Project models are
added on top via Self::model / Self::model_with_search.
Sourcepub fn site_branding(self, branding: SiteBranding) -> Self
pub fn site_branding(self, branding: SiteBranding) -> Self
Override the default RustIO branding. Project-facing API; the
builder pattern matches .model() / .model_with_search() so
chains read naturally.
Sourcepub fn branding(&self) -> &SiteBranding
pub fn branding(&self) -> &SiteBranding
Read-only access to the active branding — handlers and context builders use this to thread brand strings into templates.
pub fn model<M>(self) -> Selfwhere
M: AdminModel + Model,
Sourcepub fn model_with_search<M>(self, indexer: Indexer) -> Self
pub fn model_with_search<M>(self, indexer: Indexer) -> Self
Register a model and wire it into an async search indexer. Every create/update/delete pushes the row into the indexer’s queue — the actual HTTP round-trip to Meilisearch happens in the background.
pub fn entries(&self) -> &[AdminEntry]
pub fn find(&self, admin_name: &str) -> Option<&AdminEntry>
Sourcepub async fn seed_permissions(&self, db: &Db) -> Result<()>
pub async fn seed_permissions(&self, db: &Db) -> Result<()>
Register the canonical (add/change/delete/view) permissions for
every model. Call during startup after init_tables.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Admin
impl !RefUnwindSafe for Admin
impl Send for Admin
impl Sync for Admin
impl Unpin for Admin
impl UnsafeUnpin for Admin
impl !UnwindSafe for Admin
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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