pub struct LoggingInterceptor;Expand description
A CallInterceptor that logs each call’s
start and outcome via tracing.
Register it on a client or server transport to get one structured log line per call boundary (method, side) plus a success/failure line with the error. A drop-in for the official SDK’s logging interceptor.
Trait Implementations§
Source§impl CallInterceptor for LoggingInterceptor
impl CallInterceptor for LoggingInterceptor
Source§fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn before<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 CallContext,
) -> Pin<Box<dyn Future<Output = Result<(), A2AError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Run before the call is dispatched. Returning
Err short-circuits the
call: the dispatch is skipped and the error is returned to the caller
(after after hooks still run, observing it).Source§fn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 CallContext,
outcome: Result<(), &'life2 A2AError>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn after<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 CallContext,
outcome: Result<(), &'life2 A2AError>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Run after the call completes, observing its outcome (
Ok on success,
Err with a borrow of the error otherwise).Source§impl Clone for LoggingInterceptor
impl Clone for LoggingInterceptor
Source§fn clone(&self) -> LoggingInterceptor
fn clone(&self) -> LoggingInterceptor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LoggingInterceptor
impl Debug for LoggingInterceptor
Source§impl Default for LoggingInterceptor
impl Default for LoggingInterceptor
Source§fn default() -> LoggingInterceptor
fn default() -> LoggingInterceptor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LoggingInterceptor
impl RefUnwindSafe for LoggingInterceptor
impl Send for LoggingInterceptor
impl Sync for LoggingInterceptor
impl Unpin for LoggingInterceptor
impl UnsafeUnpin for LoggingInterceptor
impl UnwindSafe for LoggingInterceptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more