pub struct HandlerArgs { /* private fields */ }Expand description
Arguments passed to a handler.
Implementations§
Source§impl HandlerArgs
impl HandlerArgs
Sourcepub fn new(ctx: HandlerCtx, req: Request) -> Self
pub fn new(ctx: HandlerCtx, req: Request) -> Self
Create new handler arguments.
§Panics
If the ctx tracing span has not been initialized via
HandlerCtx::init_request_span.
Sourcepub fn into_parts(self) -> (HandlerCtx, Request)
pub fn into_parts(self) -> (HandlerCtx, Request)
Decompose the handler arguments into its parts.
Sourcepub const fn ctx(&self) -> &HandlerCtx
pub const fn ctx(&self) -> &HandlerCtx
Get a reference to the handler context.
Sourcepub fn span(&self) -> &Span
pub fn span(&self) -> &Span
Get a reference to the tracing span for this handler invocation.
§Panics
If the span has not been initialized via
HandlerCtx::init_request_span.
Sourcepub fn otel_span_name(&self) -> String
pub fn otel_span_name(&self) -> String
Get the OpenTelemetry span name for this handler invocation.
Sourcepub const fn service_name(&self) -> &'static str
pub const fn service_name(&self) -> &'static str
Get the service name for this handler invocation.
Trait Implementations§
Source§impl Clone for HandlerArgs
impl Clone for HandlerArgs
Source§fn clone(&self) -> HandlerArgs
fn clone(&self) -> HandlerArgs
Returns a duplicate 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 Debug for HandlerArgs
impl Debug for HandlerArgs
Source§impl Service<HandlerArgs> for &Router<()>
impl Service<HandlerArgs> for &Router<()>
Source§impl Service<HandlerArgs> for Router<()>
impl Service<HandlerArgs> for Router<()>
Auto Trait Implementations§
impl !Freeze for HandlerArgs
impl !RefUnwindSafe for HandlerArgs
impl Send for HandlerArgs
impl Sync for HandlerArgs
impl Unpin for HandlerArgs
impl UnsafeUnpin for HandlerArgs
impl !UnwindSafe for HandlerArgs
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