Skip to main content

InMemoryRings

Struct InMemoryRings 

Source
pub struct InMemoryRings { /* private fields */ }

Implementations§

Source§

impl InMemoryRings

Source

pub fn new() -> Self

Source

pub fn set_yield(&mut self, on: bool)

What yield_requested answers, for tests of an engine’s early stop.

Source

pub fn set_latency(&mut self, on: bool)

What latency_wanted answers, for tests.

Source

pub fn stage_prompt(&mut self, tokens: &[u32]) -> TokenRef

Trait Implementations§

Source§

impl Debug for InMemoryRings

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemoryRings

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Rings for InMemoryRings

Source§

fn read_tokens(&self, r: &TokenRef) -> Result<Vec<u32>, RingError>

Source§

fn write_tokens(&mut self, tokens: &[u32]) -> Result<TokenRef, RingError>

Source§

fn write_logits_row(&mut self, row: &[f32]) -> RingRef

Source§

fn read_logits_row(&self, r: &RingRef) -> Result<Vec<f32>, RingError>

Source§

fn yield_requested(&self) -> bool

The daemon wants the running tick to end at its next step boundary (a request is waiting to be admitted, or a lane was cancelled).
Source§

fn latency_wanted(&self) -> bool

Latency-sensitive requests have arrived lately: run prefill in short steps, so a yield comes soon after it is asked for.
Source§

impl StageRings for InMemoryRings

Source§

fn stage_prompt(&mut self, tokens: &[u32]) -> TokenRef

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.