pub struct UsageTap { /* private fields */ }Expand description
Usage a client has learned of a call so far — the input side, which an
Anthropic stream reports when it opens — and the node the call is charged
to. ModelEvent::EndTurn’s usage supersedes what was reported.
Reporting to a tap nobody made does nothing.
The charge is counted once, by whoever routes the call, through
UsageTap::metered: everything above the client only says where it
goes.
Implementations§
Source§impl UsageTap
impl UsageTap
Sourcepub fn metered(self, stream: ModelStream, also: Option<OnSpent>) -> ModelStream
pub fn metered(self, stream: ModelStream, also: Option<OnSpent>) -> ModelStream
stream, its usage counted once into the node this tap is charged to
and to also.
Trait Implementations§
Auto Trait Implementations§
impl Forget for UsageTap
impl Freeze for UsageTap
impl Move for UsageTap
impl RefUnwindSafe for UsageTap
impl Send for UsageTap
impl Sync for UsageTap
impl Unpin for UsageTap
impl UnsafeUnpin for UsageTap
impl UnwindSafe for UsageTap
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