Skip to main content

Capability

Trait Capability 

Source
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>(); // OK

Required Associated Constants§

Source

const ID: &'static str

The string identifier used in Casbin policies (e.g., “infer”)

Source

const CODE: char

Single character code for display (e.g., ‘i’)

Source

const DESCRIPTION: &'static str

Human-readable description

Provided Methods§

Source

fn type_id() -> TypeId

Get the TypeId for runtime type checking

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.

Implementors§

Source§

impl Capability for Context

Source§

const ID: &'static str = "context"

Source§

const CODE: char = 'c'

Source§

const DESCRIPTION: &'static str = "Context-augmented generation"

Source§

impl Capability for Infer

Source§

const ID: &'static str = "infer"

Source§

const CODE: char = 'i'

Source§

const DESCRIPTION: &'static str = "Run model inference"

Source§

impl Capability for LoraSupport

Source§

const ID: &'static str = "lora_support"

Source§

const CODE: char = 'l'

Source§

const DESCRIPTION: &'static str = "LoRA adapter support"

Source§

impl Capability for Manage

Source§

const ID: &'static str = "manage"

Source§

const CODE: char = 'm'

Source§

const DESCRIPTION: &'static str = "Administrative operations"

Source§

impl Capability for Multimodal

Source§

const ID: &'static str = "multimodal"

Source§

const CODE: char = 'v'

Source§

const DESCRIPTION: &'static str = "Multimodal (text, image, etc.)"

Source§

impl Capability for Quantization

Source§

const ID: &'static str = "quantization"

Source§

const CODE: char = 'z'

Source§

const DESCRIPTION: &'static str = "Quantization support"

Source§

impl Capability for Query

Source§

const ID: &'static str = "query"

Source§

const CODE: char = 'q'

Source§

const DESCRIPTION: &'static str = "Query data via SQL"

Source§

impl Capability for Serve

Source§

const ID: &'static str = "serve"

Source§

const CODE: char = 's'

Source§

const DESCRIPTION: &'static str = "Serve via API"

Source§

impl Capability for Train

Source§

const ID: &'static str = "train"

Source§

const CODE: char = 't'

Source§

const DESCRIPTION: &'static str = "Train or fine-tune models"

Source§

impl Capability for Write

Source§

const ID: &'static str = "write"

Source§

const CODE: char = 'w'

Source§

const DESCRIPTION: &'static str = "Write or update data"