pub trait Capability:
Sealed
+ Send
+ Sync
+ 'static {
const ID: &'static str;
const CODE: char;
const DESCRIPTION: &'static str;
// Provided method
fn type_id() -> TypeId { ... }
}Expand description
A capability that a domain can provide
Capabilities are represented as zero-sized types for compile-time type safety while maintaining runtime string compatibility for Casbin.
§Example
ⓘ
use hyprstream::archetypes::capabilities::{Capability, Infer};
// Compile-time constant access
assert_eq!(Infer::ID, "infer");
// Type-safe capability checking
fn requires_inference<C: Capability>() { }
requires_inference::<Infer>(); // OKRequired Associated Constants§
Sourceconst DESCRIPTION: &'static str
const DESCRIPTION: &'static str
Human-readable description
Provided Methods§
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.