pub struct RequestLogger;Implementations§
Trait Implementations§
Source§impl Extension for RequestLogger
impl Extension for RequestLogger
Source§fn on_response(
&self,
ctx: &RequestContext,
_raw_request: &[u8],
raw_response: &[u8],
) -> BoxFuture<'_, ()>
fn on_response( &self, ctx: &RequestContext, _raw_request: &[u8], raw_response: &[u8], ) -> BoxFuture<'_, ()>
Called after a non-streaming response arrives from the provider.
Both request and response are raw wire bytes.
Source§fn on_error(&self, ctx: &RequestContext, error: &Error) -> BoxFuture<'_, ()>
fn on_error(&self, ctx: &RequestContext, error: &Error) -> BoxFuture<'_, ()>
Called when the provider returns an error.
Source§fn storage_key(&self, suffix: &[u8]) -> Vec<u8> ⓘ
fn storage_key(&self, suffix: &[u8]) -> Vec<u8> ⓘ
Build a full storage key by prepending this extension’s prefix to
suffix.Source§fn on_cache_lookup(
&self,
_raw_request: &[u8],
) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + '_>>
fn on_cache_lookup( &self, _raw_request: &[u8], ) -> Pin<Box<dyn Future<Output = Option<Vec<u8>>> + Send + '_>>
Check for a cached response before provider dispatch. Return
Some
with raw response bytes to skip the provider call entirely.
Called for non-streaming requests only.Source§fn on_request(
&self,
_ctx: &RequestContext,
) -> Pin<Box<dyn Future<Output = Result<(), ExtensionError>> + Send + '_>>
fn on_request( &self, _ctx: &RequestContext, ) -> Pin<Box<dyn Future<Output = Result<(), ExtensionError>> + Send + '_>>
Called post-auth, pre-dispatch. Return
Err to short-circuit the pipeline
(no provider call, no further extensions run).Auto Trait Implementations§
impl Freeze for RequestLogger
impl RefUnwindSafe for RequestLogger
impl Send for RequestLogger
impl Sync for RequestLogger
impl Unpin for RequestLogger
impl UnsafeUnpin for RequestLogger
impl UnwindSafe for RequestLogger
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