pub struct AdminRegistry { /* private fields */ }Expand description
Slug → factory mapping for the /admin-new/<slug> dispatcher.
Each registered model is stored as a constructor closure; a
fresh Box<dyn AdminUiModel> is built per lookup. Hand-written
models are typically zero-sized unit structs (allocation is
effectively free); generator-driven models capture an
AdminModelConfig and clone it on each call.
Implementations§
Source§impl AdminRegistry
impl AdminRegistry
pub fn new() -> Self
Sourcepub fn register<F>(&mut self, slug: &'static str, factory: F)
pub fn register<F>(&mut self, slug: &'static str, factory: F)
Register any Fn factory under slug. A bare fn pointer
satisfies the bound, so existing call sites
(reg.register("users", new_user_admin)) continue to compile
unchanged.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdminRegistry
impl !RefUnwindSafe for AdminRegistry
impl Send for AdminRegistry
impl Sync for AdminRegistry
impl Unpin for AdminRegistry
impl UnsafeUnpin for AdminRegistry
impl !UnwindSafe for AdminRegistry
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
Mutably borrows from an owned value. Read more
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>
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 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>
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