pub struct AttemptClock { /* private fields */ }Expand description
Monotonic (Instant-based) timing capture for one transport attempt.
Every mark is set-once; unobserved stages stay None (never zero).
Implementations§
Source§impl AttemptClock
impl AttemptClock
Sourcepub fn mark_headers(&mut self)
pub fn mark_headers(&mut self)
Response headers observed (set-once).
Sourcepub fn mark_first_byte(&mut self)
pub fn mark_first_byte(&mut self)
First response body byte / SSE frame observed (set-once).
Sourcepub fn set_first_model_event_after_headers(&mut self, offset_ms: u64)
pub fn set_first_model_event_after_headers(&mut self, offset_ms: u64)
First parsed model event, expressed as a monotonic offset from the headers mark (the stream parser measures from post-headers).
Sourcepub fn mark_first_model_event(&mut self)
pub fn mark_first_model_event(&mut self)
First parsed model event, measured directly on this attempt’s own
monotonic clock (set-once). Used by transports that observe the
event on the same task that owns the clock (OpenAI-compatible
paths); the Anthropic stream parser instead reports a post-headers
offset via Self::set_first_model_event_after_headers.
Sourcepub fn set_first_model_event_offset(&mut self, offset_ms: u64)
pub fn set_first_model_event_offset(&mut self, offset_ms: u64)
First parsed model event at a caller-measured monotonic offset from this attempt’s send start (set-once). Used by transports whose stream events are observed on a task that does not own the clock (the extension-provider forwarder records the offset through an atomic and the owning task applies it here before finishing).
Sourcepub fn mark_stream_end(&mut self)
pub fn mark_stream_end(&mut self)
Stream fully consumed / request finished (set-once).
Trait Implementations§
Source§impl Clone for AttemptClock
impl Clone for AttemptClock
impl Copy for AttemptClock
Auto Trait Implementations§
impl Freeze for AttemptClock
impl RefUnwindSafe for AttemptClock
impl Send for AttemptClock
impl Sync for AttemptClock
impl Unpin for AttemptClock
impl UnsafeUnpin for AttemptClock
impl UnwindSafe for AttemptClock
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.