DeviceIo

Trait DeviceIo 

Source
pub trait DeviceIo: Send {
    type Seq;
    type Ptr: Copy + Send;
    type Model: ?Sized;
    type LoraCmd;
    type LoraAck;

    // Required methods
    fn model(&self) -> &Self::Model;
    fn facts(&self) -> DeviceFacts;
    fn max_depth(&self) -> usize;
    fn launch(
        &self,
        plan: StepPlan<'_>,
        rows: &mut [&mut Self::Seq],
    ) -> Result<Ticket, DeviceError>;
    fn await_result(
        &self,
        ticket: Ticket,
    ) -> Result<StepResult<Self::Ptr>, DeviceError>;
    fn apply(
        &self,
        effect: Effect<'_, Self::Seq, Self::Ptr>,
    ) -> Result<EffectOutcome, DeviceError>;
    fn lora(&mut self, cmd: Self::LoraCmd) -> Result<Self::LoraAck, String>;
    fn teardown(self: Box<Self>) -> Result<()>;
}

Required Associated Types§

Source

type Seq

2026-09-25: The per-sequence device bookkeeping the plans and effects mutate.

Source

type Ptr: Copy + Send

2026-09-25: The device’s logits handle.

Source

type Model: ?Sized

2026-09-25: The model behind this router, returned by Self::model for calls that go around plans and effects.

Source

type LoraCmd

2026-09-25: A LoRA control command and its acknowledgement.

Source

type LoraAck

Required Methods§

Source

fn model(&self) -> &Self::Model

Source

fn facts(&self) -> DeviceFacts

2026-09-25: The KV pool and SSM snapshot counters (DeviceFacts).

Source

fn max_depth(&self) -> usize

2026-09-25: How many steps may be in flight (1 = every step settles before the next launches).

Source

fn launch( &self, plan: StepPlan<'_>, rows: &mut [&mut Self::Seq], ) -> Result<Ticket, DeviceError>

2026-09-25: Start plan over rows; settle it with Self::await_result.

Source

fn await_result( &self, ticket: Ticket, ) -> Result<StepResult<Self::Ptr>, DeviceError>

Source

fn apply( &self, effect: Effect<'_, Self::Seq, Self::Ptr>, ) -> Result<EffectOutcome, DeviceError>

Source

fn lora(&mut self, cmd: Self::LoraCmd) -> Result<Self::LoraAck, String>

2026-09-25: A LoRA control command, applied at quiescence (the model mutates its adapter table, hence the exclusive borrow).

Source

fn teardown(self: Box<Self>) -> Result<()>

2026-09-25: Release the model’s device memory. Consumes the router.

Implementors§