pub struct ExtensionAttempt { /* private fields */ }Expand description
Per-turn trace state for one extension provider IPC invocation: the
optional tracer, this turn’s monotonic clock, and the shared first-event
cell. Every method is a no-op when tracing is disabled; nothing here can
fail the request. Exactly one finish_* record is emitted — the tracer
is taken on finish, so later calls can never double-emit.
Implementations§
Source§impl ExtensionAttempt
impl ExtensionAttempt
Sourcepub fn new(tracer: Option<RequestTracer>) -> Self
pub fn new(tracer: Option<RequestTracer>) -> Self
Start the turn clock. Call immediately before the IPC send.
Sourcepub fn first_event_mark(&self) -> FirstEventMark
pub fn first_event_mark(&self) -> FirstEventMark
Handle for the forwarder task to mark the first model event.
Sourcepub fn finish_success(
&mut self,
stop_reason: Option<StopReason>,
usage: Option<UsageMeta>,
)
pub fn finish_success( &mut self, stop_reason: Option<StopReason>, usage: Option<UsageMeta>, )
Final record: turn completed. Stop reason/usage stay None when the
extension reported nothing — never fabricated.
Sourcepub fn finish_canceled(&mut self)
pub fn finish_canceled(&mut self)
Final record: canceled while the IPC turn was active.
Sourcepub fn finish_failed(&mut self, code: &str)
pub fn finish_failed(&mut self, code: &str)
Final record: the extension turn failed. code must be a static
literal (EXTENSION_PROVIDER_ERROR_CODE) — never extension text.
Auto Trait Implementations§
impl !RefUnwindSafe for ExtensionAttempt
impl !UnwindSafe for ExtensionAttempt
impl Freeze for ExtensionAttempt
impl Send for ExtensionAttempt
impl Sync for ExtensionAttempt
impl Unpin for ExtensionAttempt
impl UnsafeUnpin for ExtensionAttempt
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
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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.