Skip to main content

WorkerClient

Struct WorkerClient 

Source
pub struct WorkerClient {
    pub hello: HelloAckW,
    pub op_done: VecDeque<StateOpDoneMsg>,
    /* private fields */
}

Fields§

§hello: HelloAckW§op_done: VecDeque<StateOpDoneMsg>

Implementations§

Source§

impl WorkerClient

Source

pub fn connect( frames: UnixStream, fd_channel: UnixStream, ) -> Result<WorkerClient, AgentError>

Source

pub fn yield_signal(&self) -> Option<YieldSignal>

The daemon’s control words for this worker (end the running tick at the next step boundary; prefill in short steps), settable from any thread.

Source

pub fn raw_frames_stream(&mut self) -> &mut UnixStream ⓘ

Source

pub fn stage_prompt( &mut self, tokens: &[u32], ) -> Result<TokenRefMsg, AgentError>

Source

pub fn read_tokens(&self, r: &TokenRefMsg) -> Result<Vec<u32>, AgentError>

Source

pub fn read_logits(&self, r: &RingRefMsg) -> Result<Vec<f32>, AgentError>

Source

pub fn tick(&mut self, plan: TickPlanMsg) -> Result<TickEventsMsg, AgentError>

Source

pub fn tick_streaming( &mut self, plan: TickPlanMsg, on_emit: &mut dyn FnMut(TickEmitMsg), ) -> Result<TickEventsMsg, AgentError>

Source

pub fn match_prefix( &mut self, space_id: u32, span: TokenRefMsg, ) -> Result<MatchResMsg, AgentError>

Source

pub fn seed_release(&mut self, seed_handle: u64) -> Result<(), AgentError>

Source

pub fn seed_acquire( &mut self, span: TokenRefMsg, prefix_len: u64, determinism_class: u8, ) -> Result<u64, AgentError>

Source

pub fn seed_acquire_leased( &mut self, span: TokenRefMsg, prefix_len: u64, determinism_class: u8, ) -> Result<(u64, Option<u64>), AgentError>

Source

pub fn buf_create(&mut self, len: u64) -> Result<u64, AgentError>

Source

pub fn buf_read(&self, buf_id: u64, len: usize) -> Result<Vec<u8>, AgentError>

Source

pub fn buf_write(&self, buf_id: u64, data: &[u8]) -> Result<(), AgentError>

Source

pub fn buf_release(&mut self, buf_id: u64) -> Result<(), AgentError>

Source

pub fn state_op(&mut self, op: StateOpKind) -> Result<u64, AgentError>

Source

pub fn wait_op_done(&mut self, op: u64) -> Result<StateOpDoneMsg, AgentError>

Source

pub fn state_sync( &mut self, req: StateSyncReqMsg, ) -> Result<StateSyncOkMsg, AgentError>

Source

pub fn send_transcribe_cancel(&mut self) -> Result<(), AgentError>

Source

pub fn state_sync_streaming( &mut self, req: StateSyncReqMsg, on_segment: &mut dyn FnMut(TranscribeSegmentMsg) -> bool, ) -> Result<StateSyncOkMsg, AgentError>

Source

pub fn register_strategy( &mut self, reg: StrategyRegisterMsg, ) -> Result<StrategyGrantOkMsg, AgentError>

Source

pub fn ping(&mut self) -> Result<PongMsg, AgentError>

Source

pub fn drain(&mut self) -> Result<(), AgentError>

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more