Struct mas_tower::DurationRecorderLayer
source · pub struct DurationRecorderLayer<OnRequest = (), OnResponse = (), OnError = ()> { /* private fields */ }
Expand description
A Layer
that records the duration of requests in milliseconds.
Implementations§
source§impl DurationRecorderLayer
impl DurationRecorderLayer
sourcepub fn new(name: &'static str) -> Self
pub fn new(name: &'static str) -> Self
Create a new DurationRecorderLayer
.
source§impl<OnRequest, OnResponse, OnError> DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest, OnResponse, OnError> DurationRecorderLayer<OnRequest, OnResponse, OnError>
sourcepub fn on_request<NewOnRequest>(
self,
on_request: NewOnRequest,
) -> DurationRecorderLayer<NewOnRequest, OnResponse, OnError>
pub fn on_request<NewOnRequest>( self, on_request: NewOnRequest, ) -> DurationRecorderLayer<NewOnRequest, OnResponse, OnError>
Set the MetricsAttributes
to use on request.
pub fn on_request_fn<F, T>( self, on_request: F, ) -> DurationRecorderLayer<FnWrapper<F>, OnResponse, OnError>
sourcepub fn on_response<NewOnResponse>(
self,
on_response: NewOnResponse,
) -> DurationRecorderLayer<OnRequest, NewOnResponse, OnError>
pub fn on_response<NewOnResponse>( self, on_response: NewOnResponse, ) -> DurationRecorderLayer<OnRequest, NewOnResponse, OnError>
Set the MetricsAttributes
to use on response.
pub fn on_response_fn<F, T>( self, on_response: F, ) -> DurationRecorderLayer<OnRequest, FnWrapper<F>, OnError>
sourcepub fn on_error<NewOnError>(
self,
on_error: NewOnError,
) -> DurationRecorderLayer<OnRequest, OnResponse, NewOnError>
pub fn on_error<NewOnError>( self, on_error: NewOnError, ) -> DurationRecorderLayer<OnRequest, OnResponse, NewOnError>
Set the MetricsAttributes
to use on error.
pub fn on_error_fn<F, T>( self, on_error: F, ) -> DurationRecorderLayer<OnRequest, OnResponse, FnWrapper<F>>
Trait Implementations§
source§impl<OnRequest: Clone, OnResponse: Clone, OnError: Clone> Clone for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest: Clone, OnResponse: Clone, OnError: Clone> Clone for DurationRecorderLayer<OnRequest, OnResponse, OnError>
source§fn clone(&self) -> DurationRecorderLayer<OnRequest, OnResponse, OnError>
fn clone(&self) -> DurationRecorderLayer<OnRequest, OnResponse, OnError>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<OnRequest: Debug, OnResponse: Debug, OnError: Debug> Debug for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest: Debug, OnResponse: Debug, OnError: Debug> Debug for DurationRecorderLayer<OnRequest, OnResponse, OnError>
source§impl<S, OnRequest, OnResponse, OnError> Layer<S> for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<S, OnRequest, OnResponse, OnError> Layer<S> for DurationRecorderLayer<OnRequest, OnResponse, OnError>
Auto Trait Implementations§
impl<OnRequest, OnResponse, OnError> Freeze for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest = (), OnResponse = (), OnError = ()> !RefUnwindSafe for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest, OnResponse, OnError> Send for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest, OnResponse, OnError> Sync for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest, OnResponse, OnError> Unpin for DurationRecorderLayer<OnRequest, OnResponse, OnError>
impl<OnRequest = (), OnResponse = (), OnError = ()> !UnwindSafe for DurationRecorderLayer<OnRequest, OnResponse, OnError>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)