ScriptedDeviceIo

Struct ScriptedDeviceIo 

Source
pub struct ScriptedDeviceIo<D: DeviceIo> { /* private fields */ }

Implementations§

Source§

impl<D: DeviceIo> ScriptedDeviceIo<D>

Source

pub fn new( inner: D, key: impl Fn(&D::Seq) -> u64 + Send + 'static, vocab: usize, max_depth: usize, ) -> Self

2026-09-25: key matches a row to its script; vocab sizes the host-logits rows; max_depth is what the router reports (never more than the inner router’s own).

Source

pub fn script(&self, key: u64, tokens: impl IntoIterator<Item = u32>)

2026-09-25: The tokens the decode lane will read back for the row keyed key, in order. A row with no line left answers what the inner router answered.

Source

pub fn fail_next(&self, fault: Fault)

2026-09-25: Raise fault on the next launch (queued, in order).

Source

pub fn effects(&self) -> Vec<String>

2026-09-25: Every effect and LoRA command applied so far, by label, in order.

Source

pub fn launches(&self) -> usize

Source

pub fn inner(&self) -> &D

Trait Implementations§

Source§

impl<D: DeviceIo> DeviceIo for ScriptedDeviceIo<D>
where D::LoraCmd: Label,

Source§

type Seq = <D as DeviceIo>::Seq

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

type Ptr = <D as DeviceIo>::Ptr

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

type Model = <D as DeviceIo>::Model

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

type LoraCmd = <D as DeviceIo>::LoraCmd

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

type LoraAck = <D as DeviceIo>::LoraAck

Source§

fn model(&self) -> &D::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 D::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<D::Ptr>, DeviceError>

Source§

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

Source§

fn lora(&mut self, cmd: D::LoraCmd) -> Result<D::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.

Auto Trait Implementations§

§

impl<D> !Freeze for ScriptedDeviceIo<D>

§

impl<D> !RefUnwindSafe for ScriptedDeviceIo<D>

§

impl<D> Send for ScriptedDeviceIo<D>

§

impl<D> !Sync for ScriptedDeviceIo<D>

§

impl<D> Unpin for ScriptedDeviceIo<D>
where D: Unpin, <D as DeviceIo>::Ptr: Unpin,

§

impl<D> !UnwindSafe for ScriptedDeviceIo<D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.