pub trait Entity:
Sized
+ Send
+ Sync
+ 'static {
type Service: Send + Sync;
// Required methods
fn resource_name() -> &'static str;
fn resource_name_singular() -> &'static str;
fn service_from_host(
host: &Arc<dyn Any + Send + Sync>,
) -> Result<Arc<Self::Service>>;
}Expand description
Base trait for all entities in the system.
This trait provides the fundamental metadata needed to work with any entity type, including routing information and service access.
Required Associated Types§
Required Methods§
Sourcefn resource_name() -> &'static str
fn resource_name() -> &'static str
The plural resource name used in URLs (e.g., “users”, “companies”)
Sourcefn resource_name_singular() -> &'static str
fn resource_name_singular() -> &'static str
The singular resource name (e.g., “user”, “company”)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.