pub struct ProviderEventSink { /* private fields */ }Expand description
Sink supplied to providers that can produce incremental output.
Providers that only return a final response can keep implementing
AgentProvider::invoke. Streaming providers call Self::output_delta
while their invocation is running.
Implementations§
Source§impl ProviderEventSink
impl ProviderEventSink
Sourcepub fn from_fn(emit: impl Fn(ProviderEvent) + Send + Sync + 'static) -> Self
pub fn from_fn(emit: impl Fn(ProviderEvent) + Send + Sync + 'static) -> Self
Creates a sink that forwards every typed provider event to emit.
pub fn discard() -> Self
pub fn output_delta(&self, data: InvocationData)
pub fn activity(&self)
pub fn stage_started(&self, stage: ProviderStage, metadata: Value)
pub fn stage_completed( &self, stage: ProviderStage, elapsed_ms: u64, metadata: Value, )
pub fn stage_failed( &self, stage: ProviderStage, elapsed_ms: u64, error: impl Into<String>, metadata: Value, )
Trait Implementations§
Source§impl Clone for ProviderEventSink
impl Clone for ProviderEventSink
Source§fn clone(&self) -> ProviderEventSink
fn clone(&self) -> ProviderEventSink
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ProviderEventSink
impl !UnwindSafe for ProviderEventSink
impl Freeze for ProviderEventSink
impl Send for ProviderEventSink
impl Sync for ProviderEventSink
impl Unpin for ProviderEventSink
impl UnsafeUnpin for ProviderEventSink
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.