Skip to main content

NativeAsyncCoordinator

Struct NativeAsyncCoordinator 

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

Implementations§

Source§

impl NativeAsyncCoordinator

Source

pub async fn open( journal: Box<dyn NativeAsyncJournal>, executor: Arc<dyn NativeAsyncExecutor>, max_concurrency: usize, parallel_tool_calls: bool, ) -> Result<Self>

Recover only after acquiring the journal’s exclusive ownership fence. Safe calls are reauthorized and restarted; unsafe calls become explicit interrupted outputs. Ambiguous HTTP delivery requires receipt recovery.

Source

pub fn checkpoint(&self) -> &NativeAsyncCheckpoint

Source

pub async fn persist_host_outcome(&mut self, outcome: Value) -> Result<()>

Source

pub async fn release(&mut self) -> Result<()>

Source

pub async fn register(&mut self, call: NativeToolCall) -> Result<()>

Source

pub async fn begin_transcript_response( &mut self, message_id: String, ) -> Result<()>

Source

pub async fn stage_transcript_result(&mut self, result: Value) -> Result<()>

Source

pub async fn transcript_committed(&mut self, message_id: &str) -> Result<()>

Source

pub async fn begin_response(&mut self) -> Result<()>

Record request intent before a host opens its provider HTTP stream.

Source

pub async fn next_response_event( &mut self, stream: &mut LlmResponseStream, ) -> Result<LlmStreamEvent>

Drive jobs alongside one stream event, retaining call events for the host’s normal transcript pipeline. A completed response is not a turn end.

Source

pub async fn pump( &mut self, stream: LlmResponseStream, observe: impl FnMut(LlmStreamEvent), ) -> Result<()>

Consume a response while jobs execute. Returns once the provider response is complete, even if async work remains. Independent follow-up responses may be pumped before waiting for jobs. observe receives prose/reasoning unchanged; only executable call events are consumed by the coordinator.

Source

pub async fn wait_next(&mut self) -> Result<bool>

Wait for one completion; outputs may be delivered out of launch order.

Source

pub async fn prepare_delivery(&mut self) -> Result<Option<Delivery>>

Persist the delivery intent before the caller submits its HTTP request. Synchronous calls must all finish before the provider can continue.

Source

pub async fn cancel(&mut self) -> Result<()>

Dropping owned futures cancels local execution. Persist cancellation outputs; the conversation remains incomplete until they are delivered.

Source§

impl NativeAsyncCoordinator

Source

pub async fn run<Request, RequestFuture>( &mut self, max_responses: usize, request: Request, observe: impl FnMut(LlmStreamEvent), ) -> Result<()>
where Request: FnMut(Option<Delivery>, Option<String>) -> RequestFuture, RequestFuture: Future<Output = Result<LlmResponseStream>>,

Drive HTTP response continuations through completion, returning only when every accepted call’s output has a provider receipt. The caller supplies request construction; no transport or model defaults are chosen here.

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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