pub struct NativeMessagesDecoder { /* private fields */ }Expand description
Decoder for a native Messages stream that is relayed to the caller
unchanged: every event is handed back verbatim, and the only work done is
folding Anthropic’s split usage reporting — input tokens on message_start,
output tokens on message_delta — into one ModelUsage.
Implementations§
Trait Implementations§
Source§impl Default for NativeMessagesDecoder
impl Default for NativeMessagesDecoder
Source§fn default() -> NativeMessagesDecoder
fn default() -> NativeMessagesDecoder
Returns the “default value” for a type. Read more
Source§impl ProviderStreamDecoder for NativeMessagesDecoder
impl ProviderStreamDecoder for NativeMessagesDecoder
fn decode( &mut self, event: SseEvent, ) -> Result<Vec<ProviderStreamEvent>, ProviderError>
fn finish(&mut self) -> Result<Vec<ProviderStreamEvent>, ProviderError>
Auto Trait Implementations§
impl Freeze for NativeMessagesDecoder
impl RefUnwindSafe for NativeMessagesDecoder
impl Send for NativeMessagesDecoder
impl Sync for NativeMessagesDecoder
impl Unpin for NativeMessagesDecoder
impl UnsafeUnpin for NativeMessagesDecoder
impl UnwindSafe for NativeMessagesDecoder
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