pub struct AdminInstance {
pub config: Arc<AdminConfig>,
pub registry: Arc<ModelRegistry>,
pub data_source: Arc<dyn DataSource>,
}Expand description
Built admin instance
Fields§
§config: Arc<AdminConfig>Configuration
registry: Arc<ModelRegistry>Model registry
data_source: Arc<dyn DataSource>Backing data source
Implementations§
Source§impl AdminInstance
impl AdminInstance
Sourcepub fn config(&self) -> &AdminConfig
pub fn config(&self) -> &AdminConfig
Get the configuration
Sourcepub fn registry(&self) -> &ModelRegistry
pub fn registry(&self) -> &ModelRegistry
Get the model registry
Sourcepub fn data_source(&self) -> &Arc<dyn DataSource>
pub fn data_source(&self) -> &Arc<dyn DataSource>
Get the backing data source
Sourcepub fn routes(&self) -> Router
pub fn routes(&self) -> Router
Build a mountable armature_core::Router for the admin interface.
Every route renders HTML through the view structs and is backed by the
configured DataSource. When require_auth is set, mutating and
browsing routes require an Authorization header.
Registered routes (relative to base_path, default /admin):
GET {base}— dashboardGET {base}/:model— listGET {base}/:model/add+POST {base}/:model/add— createGET {base}/:model/:id— detailGET {base}/:model/:id/edit+POST {base}/:model/:id/edit— updatePOST {base}/:model/:id/delete(alsoDELETE {base}/:model/:id) — delete
Sourcepub fn get_model(&self, name: &str) -> Option<&ModelDefinition>
pub fn get_model(&self, name: &str) -> Option<&ModelDefinition>
Get a model definition by name
Sourcepub fn models(&self) -> Vec<&ModelDefinition>
pub fn models(&self) -> Vec<&ModelDefinition>
List all registered models
Trait Implementations§
Source§impl Clone for AdminInstance
impl Clone for AdminInstance
Source§fn clone(&self) -> AdminInstance
fn clone(&self) -> AdminInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for AdminInstance
impl !UnwindSafe for AdminInstance
impl Freeze for AdminInstance
impl Send for AdminInstance
impl Sync for AdminInstance
impl Unpin for AdminInstance
impl UnsafeUnpin for AdminInstance
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R, D> DepsPresent<D> for R
Source§impl<T> Injectable for T
impl<T> Injectable for T
Source§fn type_id_of() -> TypeIdwhere
Self: Sized,
fn type_id_of() -> TypeIdwhere
Self: Sized,
Returns the TypeId of this type (for internal use)
Source§fn type_name_of() -> &'static strwhere
Self: Sized,
fn type_name_of() -> &'static strwhere
Self: Sized,
Returns the type name for debugging