pub struct EntityRegistry { /* private fields */ }Expand description
Registry for all entities in the application
This registry collects entity descriptors from all registered modules and can generate a router with all CRUD routes.
Implementations§
Source§impl EntityRegistry
impl EntityRegistry
Sourcepub fn register(&mut self, descriptor: Box<dyn EntityDescriptor>)
pub fn register(&mut self, descriptor: Box<dyn EntityDescriptor>)
Register an entity descriptor
The entity type name will be used as the key.
Sourcepub fn build_routes(&self) -> Router
pub fn build_routes(&self) -> Router
Build a router with all registered entity routes
This merges all entity routes into a single router.
Sourcepub fn entity_types(&self) -> Vec<&str>
pub fn entity_types(&self) -> Vec<&str>
Get all registered entity types
Trait Implementations§
Source§impl Default for EntityRegistry
impl Default for EntityRegistry
Source§fn default() -> EntityRegistry
fn default() -> EntityRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EntityRegistry
impl !RefUnwindSafe for EntityRegistry
impl Send for EntityRegistry
impl Sync for EntityRegistry
impl Unpin for EntityRegistry
impl !UnwindSafe for EntityRegistry
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