pub struct RequestWriterService<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> RequestWriterService<S, W>
impl<S, W> RequestWriterService<S, W>
Sourcepub const fn new(inner: S, writer: W) -> Self
pub const fn new(inner: S, writer: W) -> Self
Create a new RequestWriterService with a custom RequestWriter.
Source§impl<S> RequestWriterService<S, UnboundedSender<Request>>
impl<S> RequestWriterService<S, UnboundedSender<Request>>
Sourcepub fn writer_unbounded<W>(
inner: S,
executor: &Executor,
writer: W,
mode: Option<WriterMode>,
) -> Self
pub fn writer_unbounded<W>( inner: S, executor: &Executor, writer: W, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterService that prints requests to an AsyncWriter
over an unbounded channel
Sourcepub fn stdout_unbounded(
inner: S,
executor: &Executor,
mode: Option<WriterMode>,
) -> Self
pub fn stdout_unbounded( inner: S, executor: &Executor, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterService that prints requests to stdout
over an unbounded channel.
Sourcepub fn stderr_unbounded(
inner: S,
executor: &Executor,
mode: Option<WriterMode>,
) -> Self
pub fn stderr_unbounded( inner: S, executor: &Executor, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterService that prints requests to stderr
over an unbounded channel.
Source§impl<S> RequestWriterService<S, Sender<Request>>
impl<S> RequestWriterService<S, Sender<Request>>
Sourcepub fn writer<W>(
inner: S,
executor: &Executor,
writer: W,
buffer_size: usize,
mode: Option<WriterMode>,
) -> Self
pub fn writer<W>( inner: S, executor: &Executor, writer: W, buffer_size: usize, mode: Option<WriterMode>, ) -> Self
Create a new RequestWriterService that prints requests to an AsyncWriter
over a bounded channel with a fixed buffer size.
Sourcepub fn stdout(
inner: S,
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
) -> Self
pub fn stdout( inner: S, 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(
inner: S,
executor: &Executor,
buffer_size: usize,
mode: Option<WriterMode>,
) -> Self
pub fn stderr( inner: S, 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<S: Clone, W: Clone> Clone for RequestWriterService<S, W>
impl<S: Clone, W: Clone> Clone for RequestWriterService<S, W>
Source§fn clone(&self) -> RequestWriterService<S, W>
fn clone(&self) -> RequestWriterService<S, 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<S: Debug, W> Debug for RequestWriterService<S, W>
impl<S: Debug, W> Debug for RequestWriterService<S, W>
Auto Trait Implementations§
impl<S, W> Freeze for RequestWriterService<S, W>
impl<S, W> RefUnwindSafe for RequestWriterService<S, W>where
S: RefUnwindSafe,
W: RefUnwindSafe,
impl<S, W> Send for RequestWriterService<S, W>
impl<S, W> Sync for RequestWriterService<S, W>
impl<S, W> Unpin for RequestWriterService<S, W>
impl<S, W> UnsafeUnpin for RequestWriterService<S, W>where
S: UnsafeUnpin,
W: UnsafeUnpin,
impl<S, W> UnwindSafe for RequestWriterService<S, W>where
S: UnwindSafe,
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<S, Input, Connection> ConnectorService<Input> for S
impl<S, Input, Connection> ConnectorService<Input> for S
Source§type Connection = Connection
type Connection = Connection
ConnectorServiceSource§type Error = <S as Service<Input>>::Error
type Error = <S as Service<Input>>::Error
Source§fn connect(
&self,
input: Input,
) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, <S as ConnectorService<Input>>::Error>> + Send
fn connect( &self, input: Input, ) -> impl Future<Output = Result<EstablishedClientConnection<<S as ConnectorService<Input>>::Connection, Input>, <S as ConnectorService<Input>>::Error>> + Send
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<S, Body> HttpClientExt for S
impl<S, Body> HttpClientExt for S
Source§type ExecuteResponse = Response<Body>
type ExecuteResponse = Response<Body>
execute method.Source§type ExecuteError = <S as Service<Request>>::Error
type ExecuteError = <S as Service<Request>>::Error
execute method.Source§fn get(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn get( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
GET request to a URL. Read moreSource§fn post(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn post( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
POST request to a URL. Read moreSource§fn put(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn put( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
PUT request to a URL. Read moreSource§fn patch(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn patch( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
PATCH request to a URL. Read moreSource§fn delete(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn delete( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
DELETE request to a URL. Read moreSource§fn head(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn head( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
HEAD request to a URL. Read moreSource§fn connect(
&self,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn connect( &self, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
CONNECT request to a URL. Read moreSource§fn request(
&self,
method: Method,
url: impl IntoUrl,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn request( &self, method: Method, url: impl IntoUrl, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Source§fn build_from_request<RequestBody>(
&self,
request: Request<RequestBody>,
) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
fn build_from_request<RequestBody>( &self, request: Request<RequestBody>, ) -> RequestBuilder<'_, S, <S as HttpClientExt>::ExecuteResponse>
Source§fn execute(
&self,
request: Request,
) -> impl Future<Output = Result<<S as HttpClientExt>::ExecuteResponse, <S as HttpClientExt>::ExecuteError>>
fn execute( &self, request: Request, ) -> impl Future<Output = Result<<S as HttpClientExt>::ExecuteResponse, <S as HttpClientExt>::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 moreSource§impl<S> IntoEndpointService<(S,)> for S
impl<S> IntoEndpointService<(S,)> for S
type Service = S
Source§fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
fn into_endpoint_service(self) -> <S as IntoEndpointService<(S,)>>::Service
rama_core::Service.Source§impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
impl<S, State> IntoEndpointServiceWithState<(S,), State> for S
type Service = S
Source§fn into_endpoint_service_with_state(
self,
_state: State,
) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
fn into_endpoint_service_with_state( self, _state: State, ) -> <S as IntoEndpointServiceWithState<(S,), State>>::Service
rama_core::Service with state.