Struct RequestWriterInspector
pub struct RequestWriterInspector<W> { /* private fields */ }
Expand description
Middleware to print Http request in std format.
See the module docs for more details.
Implementations§
§impl<W> RequestWriterInspector<W>
impl<W> RequestWriterInspector<W>
pub const fn new(writer: W) -> RequestWriterInspector<W>
pub const fn new(writer: W) -> RequestWriterInspector<W>
Create a new RequestWriterInspector
with a custom RequestWriter
.
§impl RequestWriterInspector<UnboundedSender<Request>>
impl RequestWriterInspector<UnboundedSender<Request>>
pub fn writer_unbounded<W>(
executor: &Executor,
writer: W,
mode: Option<WriterMode>,
) -> RequestWriterInspector<UnboundedSender<Request>>
pub fn writer_unbounded<W>( executor: &Executor, writer: W, mode: Option<WriterMode>, ) -> RequestWriterInspector<UnboundedSender<Request>>
Create a new RequestWriterInspector
that prints requests to an [AsyncWrite
]r
over an unbounded channel
pub fn stdout_unbounded(
executor: &Executor,
mode: Option<WriterMode>,
) -> RequestWriterInspector<UnboundedSender<Request>>
pub fn stdout_unbounded( executor: &Executor, mode: Option<WriterMode>, ) -> RequestWriterInspector<UnboundedSender<Request>>
Create a new RequestWriterInspector
that prints requests to stdout
over an unbounded channel.
pub fn stderr_unbounded(
executor: &Executor,
mode: Option<WriterMode>,
) -> RequestWriterInspector<UnboundedSender<Request>>
pub fn stderr_unbounded( executor: &Executor, mode: Option<WriterMode>, ) -> RequestWriterInspector<UnboundedSender<Request>>
Create a new RequestWriterInspector
that prints requests to stderr
over an unbounded channel.
§impl RequestWriterInspector<Sender<Request>>
impl RequestWriterInspector<Sender<Request>>
pub fn writer<W>(
executor: &Executor,
writer: W,
buffer_size: usize,
mode: Option<WriterMode>,
) -> RequestWriterInspector<Sender<Request>>
pub fn writer<W>( executor: &Executor, writer: W, buffer_size: usize, mode: Option<WriterMode>, ) -> RequestWriterInspector<Sender<Request>>
Create a new RequestWriterInspector
that prints requests to an [AsyncWrite
]r
over a bounded channel with a fixed buffer size.
pub fn stdout(
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
) -> RequestWriterInspector<Sender<Request>>
pub fn stdout( executor: &Executor, buffer_size: usize, mode: Option<WriterMode>, ) -> RequestWriterInspector<Sender<Request>>
Create a new RequestWriterInspector
that prints requests to stdout
over a bounded channel with a fixed buffer size.
pub fn stderr(
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
) -> RequestWriterInspector<Sender<Request>>
pub fn stderr( executor: &Executor, buffer_size: usize, mode: Option<WriterMode>, ) -> RequestWriterInspector<Sender<Request>>
Create a new RequestWriterInspector
that prints requests to stderr
over a bounded channel with a fixed buffer size.
Trait Implementations§
§impl<W> Clone for RequestWriterInspector<W>where
W: Clone,
impl<W> Clone for RequestWriterInspector<W>where
W: Clone,
§fn clone(&self) -> RequestWriterInspector<W>
fn clone(&self) -> RequestWriterInspector<W>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<W> Debug for RequestWriterInspector<W>
impl<W> Debug for RequestWriterInspector<W>
§impl<W, ReqBody> Service<Request<ReqBody>> for RequestWriterInspector<W>
impl<W, ReqBody> Service<Request<ReqBody>> for RequestWriterInspector<W>
§async fn serve(
&self,
ctx: Context,
req: Request<ReqBody>,
) -> Result<(Context, Request), <RequestWriterInspector<W> as Service<Request<ReqBody>>>::Error>
async fn serve( &self, ctx: Context, req: Request<ReqBody>, ) -> Result<(Context, Request), <RequestWriterInspector<W> as Service<Request<ReqBody>>>::Error>
§fn boxed(self) -> BoxService<Request, Self::Response, Self::Error>
fn boxed(self) -> BoxService<Request, Self::Response, Self::Error>
Auto Trait Implementations§
impl<W> Freeze for RequestWriterInspector<W>where
W: Freeze,
impl<W> RefUnwindSafe for RequestWriterInspector<W>where
W: RefUnwindSafe,
impl<W> Send for RequestWriterInspector<W>where
W: Send,
impl<W> Sync for RequestWriterInspector<W>where
W: Sync,
impl<W> Unpin for RequestWriterInspector<W>where
W: Unpin,
impl<W> UnwindSafe for RequestWriterInspector<W>where
W: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more