pub struct ResponseWriterService<S, W> { /* private fields */ }
Expand description
Middleware to print Http request in std format.
See the module docs for more details.
Implementations§
Source§impl<S, W> ResponseWriterService<S, W>
impl<S, W> ResponseWriterService<S, W>
Sourcepub const fn new(writer: W, inner: S) -> Self
pub const fn new(writer: W, inner: S) -> Self
Create a new ResponseWriterService
with a custom ResponseWriter
.
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Consumes self
, returning the underlying service.
Source§impl<S> ResponseWriterService<S, UnboundedSender<Response>>
impl<S> ResponseWriterService<S, UnboundedSender<Response>>
Sourcepub fn writer_unbounded<W>(
executor: &Executor,
writer: W,
mode: Option<WriterMode>,
inner: S,
) -> Self
pub fn writer_unbounded<W>( executor: &Executor, writer: W, mode: Option<WriterMode>, inner: S, ) -> Self
Create a new ResponseWriterService
that prints responses to an AsyncWrite
r
over an unbounded channel
Sourcepub fn stdout_unbounded(
executor: &Executor,
mode: Option<WriterMode>,
inner: S,
) -> Self
pub fn stdout_unbounded( executor: &Executor, mode: Option<WriterMode>, inner: S, ) -> Self
Create a new ResponseWriterService
that prints responses to stdout
over an unbounded channel.
Sourcepub fn stderr_unbounded(
executor: &Executor,
mode: Option<WriterMode>,
inner: S,
) -> Self
pub fn stderr_unbounded( executor: &Executor, mode: Option<WriterMode>, inner: S, ) -> Self
Create a new ResponseWriterService
that prints responses to stderr
over an unbounded channel.
Source§impl<S> ResponseWriterService<S, Sender<Response>>
impl<S> ResponseWriterService<S, Sender<Response>>
Sourcepub fn writer<W>(
executor: &Executor,
writer: W,
buffer_size: usize,
mode: Option<WriterMode>,
inner: S,
) -> Self
pub fn writer<W>( executor: &Executor, writer: W, buffer_size: usize, mode: Option<WriterMode>, inner: S, ) -> Self
Create a new ResponseWriterService
that prints responses to an AsyncWrite
r
over a bounded channel with a fixed buffer size.
Sourcepub fn stdout(
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
inner: S,
) -> Self
pub fn stdout( executor: &Executor, buffer_size: usize, mode: Option<WriterMode>, inner: S, ) -> Self
Create a new ResponseWriterService
that prints responses to stdout
over a bounded channel with a fixed buffer size.
Sourcepub fn stderr(
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
inner: S,
) -> Self
pub fn stderr( executor: &Executor, buffer_size: usize, mode: Option<WriterMode>, inner: S, ) -> Self
Create a new ResponseWriterService
that prints responses to stderr
over a bounded channel with a fixed buffer size.
Trait Implementations§
Source§impl<S: Debug, W> Debug for ResponseWriterService<S, W>
impl<S: Debug, W> Debug for ResponseWriterService<S, W>
Auto Trait Implementations§
impl<S, W> Freeze for ResponseWriterService<S, W>
impl<S, W> RefUnwindSafe for ResponseWriterService<S, W>where
S: RefUnwindSafe,
W: RefUnwindSafe,
impl<S, W> Send for ResponseWriterService<S, W>
impl<S, W> Sync for ResponseWriterService<S, W>
impl<S, W> Unpin for ResponseWriterService<S, W>
impl<S, W> UnwindSafe for ResponseWriterService<S, W>where
S: UnwindSafe,
W: UnwindSafe,
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
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<State, S, Body> HttpClientExt<State> for S
impl<State, S, Body> HttpClientExt<State> for S
Source§type ExecuteResponse = Response<Body>
type ExecuteResponse = Response<Body>
execute
method.Source§type ExecuteError = <S as Service<State, Request<Body>>>::Error
type ExecuteError = <S as Service<State, Request<Body>>>::Error
execute
method.Source§fn get(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn get( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
GET
request to a URL. Read moreSource§fn post(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn post( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
POST
request to a URL. Read moreSource§fn put(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn put( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
PUT
request to a URL. Read moreSource§fn patch(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn patch( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
PATCH
request to a URL. Read moreSource§fn delete(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn delete( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
DELETE
request to a URL. Read moreSource§fn head(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn head( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
HEAD
request to a URL. Read moreSource§fn request(
&self,
method: Method,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
fn request( &self, method: Method, url: impl IntoUrl, ) -> RequestBuilder<'_, S, State, <S as HttpClientExt<State>>::ExecuteResponse>
Source§fn execute(
&self,
ctx: Context<State>,
request: Request<Body>,
) -> impl Future<Output = Result<<S as HttpClientExt<State>>::ExecuteResponse, <S as HttpClientExt<State>>::ExecuteError>>
fn execute( &self, ctx: Context<State>, request: Request<Body>, ) -> impl Future<Output = Result<<S as HttpClientExt<State>>::ExecuteResponse, <S as HttpClientExt<State>>::ExecuteError>>
Request
. Read moreSource§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