pub struct UsageSink(/* private fields */);Expand description
A handle executors report usage through; cloning shares the observer.
Implementations§
Source§impl UsageSink
impl UsageSink
pub fn new(observer: Arc<dyn UsageObserver>) -> Self
Sourcepub fn with_websocket(
self,
observer: Option<Arc<dyn WebSocketObserver>>,
) -> Self
pub fn with_websocket( self, observer: Option<Arc<dyn WebSocketObserver>>, ) -> Self
Attach the attempt’s WebSocket response observer.
Sourcepub fn websocket(&self) -> Option<Arc<dyn WebSocketObserver>>
pub fn websocket(&self) -> Option<Arc<dyn WebSocketObserver>>
The attached WebSocket response observer, if any.
Sourcepub fn with_capture(self, capture: CaptureSink) -> Self
pub fn with_capture(self, capture: CaptureSink) -> Self
Attach request capture without changing ExecRequest construction sites.
pub fn wants_claude_cache(&self) -> bool
pub fn claude_cache(&self, telemetry: ClaudeCacheTelemetry)
pub fn response_body(&self, format: Format, body: &[u8])
pub fn response_line(&self, format: Format, line: &[u8])
Sourcepub fn response_usage_line(&self, format: Format, line: &[u8])
pub fn response_usage_line(&self, format: Format, line: &[u8])
pub fn request(&self, format: Format, payload: &[u8])
pub fn plugin_executor(&self, provider: &str)
pub fn delegated_executor(&self, executor_type: &str, model: &str)
pub fn plugin_response_body(&self, protocol: &str, body: &[u8])
pub fn plugin_response_line(&self, protocol: &str, line: &[u8])
pub fn publish_failure_with_usage(&self, status: u16, body: &str)
pub fn request_for(&self, identifier: &str, payload: &[u8])
pub fn upstream_model(&self, model: &str)
pub fn response_model(&self, model: &str)
Sourcepub fn response_model_line(&self, line: &[u8])
pub fn response_model_line(&self, line: &[u8])
pub fn round_trip_started(&self)
pub fn first_byte(&self)
pub fn token_event(&self, is_token: bool)
pub fn publish(&self)
pub fn publish_failure(&self, status: u16, body: &str)
pub fn usage_required(&self)
Sourcepub fn upstream_stage(&self, stage: UpstreamStage)
pub fn upstream_stage(&self, stage: UpstreamStage)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UsageSink
impl !UnwindSafe for UsageSink
impl Forget for UsageSink
impl Freeze for UsageSink
impl Move for UsageSink
impl Send for UsageSink
impl Sync for UsageSink
impl Unpin for UsageSink
impl UnsafeUnpin for UsageSink
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