pub struct RequestWriterLayer<W> { /* private fields */ }Expand description
Middleware to print Http request in std format.
See the module docs for more details.
Implementations§
Source§impl<W> RequestWriterLayer<W>
impl<W> RequestWriterLayer<W>
Sourcepub const fn new(writer: W) -> Self
pub const fn new(writer: W) -> Self
Create a new RequestWriterLayer with a custom RequestWriter.
Source§impl RequestWriterLayer<UnboundedSender<Request>>
impl RequestWriterLayer<UnboundedSender<Request>>
Sourcepub fn writer_unbounded<W>(
executor: &Executor,
writer: W,
mode: Option<WriterMode>,
) -> Self
pub fn writer_unbounded<W>( executor: &Executor, writer: W, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterLayer that prints requests to an AsyncWriter
over an unbounded channel
Sourcepub fn stdout_unbounded(executor: &Executor, mode: Option<WriterMode>) -> Self
pub fn stdout_unbounded(executor: &Executor, mode: Option<WriterMode>) -> Self
Create a new RequestWriterService that prints requests to stdout
over an unbounded channel.
Sourcepub fn stderr_unbounded(executor: &Executor, mode: Option<WriterMode>) -> Self
pub fn stderr_unbounded(executor: &Executor, mode: Option<WriterMode>) -> Self
Create a new RequestWriterService that prints requests to stderr
over an unbounded channel.
Source§impl RequestWriterLayer<Sender<Request>>
impl RequestWriterLayer<Sender<Request>>
Sourcepub fn writer<W>(
executor: &Executor,
writer: W,
buffer_size: usize,
mode: Option<WriterMode>,
) -> Self
pub fn writer<W>( executor: &Executor, writer: W, buffer_size: usize, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterLayer that prints requests to an AsyncWriter
over a bounded channel with a fixed buffer size.
Sourcepub fn stdout(
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
) -> Self
pub fn stdout( executor: &Executor, buffer_size: usize, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterService that prints requests to stdout
over a bounded channel with a fixed buffer size.
Sourcepub fn stderr(
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
) -> Self
pub fn stderr( executor: &Executor, buffer_size: usize, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterService that prints requests to stderr
over a bounded channel with a fixed buffer size.
Trait Implementations§
Source§impl<W: Clone> Clone for RequestWriterLayer<W>
impl<W: Clone> Clone for RequestWriterLayer<W>
Source§fn clone(&self) -> RequestWriterLayer<W>
fn clone(&self) -> RequestWriterLayer<W>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<W> Debug for RequestWriterLayer<W>
impl<W> Debug for RequestWriterLayer<W>
Source§impl<S, W: Clone> Layer<S> for RequestWriterLayer<W>
impl<S, W: Clone> Layer<S> for RequestWriterLayer<W>
Source§type Service = RequestWriterService<S, W>
type Service = RequestWriterService<S, W>
Source§fn layer(&self, inner: S) -> Self::Service
fn layer(&self, inner: S) -> Self::Service
Source§fn into_layer(self, inner: S) -> Self::Service
fn into_layer(self, inner: S) -> Self::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<W> Freeze for RequestWriterLayer<W>where
W: Freeze,
impl<W> RefUnwindSafe for RequestWriterLayer<W>where
W: RefUnwindSafe,
impl<W> Send for RequestWriterLayer<W>where
W: Send,
impl<W> Sync for RequestWriterLayer<W>where
W: Sync,
impl<W> Unpin for RequestWriterLayer<W>where
W: Unpin,
impl<W> UnsafeUnpin for RequestWriterLayer<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for RequestWriterLayer<W>where
W: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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