pub trait IDbContextKey: Send + Sync {
// Required method
fn name(&self) -> &str;
}Expand description
Identity of a keyed DbContext.
name() must stay stable for the entity model: it is the string used by
#[context("name")] / #[entity(T, "name")].
Prefer #[derive(DbContextKey)], which implements this trait and
From<Key> for rust_dix::ServiceKey (typed key for registration, resolution
and #[inject(owned, key = Key::Read)]). Manual implementations must also
provide that From impl (the official rust-dix extension contract).
&str, &String and String are implemented for source compatibility and
register as string keys.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".