pub struct BidirectionalWriter<S> { /* private fields */ }
Expand description
A writer that can write both requests and responses.
Implementations§
Source§impl BidirectionalWriter<UnboundedSender<BidirectionalMessage>>
impl BidirectionalWriter<UnboundedSender<BidirectionalMessage>>
Sourcepub fn unbounded<W>(
executor: &Executor,
writer: W,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn unbounded<W>( executor: &Executor, writer: W, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
with a custom writer gated behind an unbounded sender.
Sourcepub fn stdout_unbounded(
executor: &Executor,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn stdout_unbounded( executor: &Executor, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
that prints requests and responses to stdout
over an unbounded channel.
Sourcepub fn stderr_unbounded(
executor: &Executor,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn stderr_unbounded( executor: &Executor, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
that prints requests and responses to stderr
over an unbounded channel.
Source§impl BidirectionalWriter<Sender<BidirectionalMessage>>
impl BidirectionalWriter<Sender<BidirectionalMessage>>
Sourcepub fn new<W>(
executor: &Executor,
writer: W,
buffer: usize,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn new<W>( executor: &Executor, writer: W, buffer: usize, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
with a custom writer gated behind a custom bounded channel.
Sourcepub fn last<W>(
executor: &Executor,
writer: W,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn last<W>( executor: &Executor, writer: W, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
with a custom writer that only writes the last request and response received.
Sourcepub fn stdout(
executor: &Executor,
buffer: usize,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn stdout( executor: &Executor, buffer: usize, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
that prints requests and responses to stdout
over a bounded channel.
Sourcepub fn stdout_last(
executor: &Executor,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn stdout_last( executor: &Executor, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
that prints the last request and response to stdout.
Sourcepub fn stderr(
executor: &Executor,
buffer: usize,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn stderr( executor: &Executor, buffer: usize, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
that prints requests and responses to stderr
over a bounded channel.
Sourcepub fn stderr_last(
executor: &Executor,
request_mode: Option<WriterMode>,
response_mode: Option<WriterMode>,
) -> Self
pub fn stderr_last( executor: &Executor, request_mode: Option<WriterMode>, response_mode: Option<WriterMode>, ) -> Self
Create a new BidirectionalWriter
that prints the last request and responses to stderr.
Trait Implementations§
Source§impl<S: Clone> Clone for BidirectionalWriter<S>
impl<S: Clone> Clone for BidirectionalWriter<S>
Source§impl<S> Debug for BidirectionalWriter<S>
impl<S> Debug for BidirectionalWriter<S>
Source§impl RequestWriter for BidirectionalWriter<Sender<BidirectionalMessage>>
impl RequestWriter for BidirectionalWriter<Sender<BidirectionalMessage>>
Source§async fn write_request(&self, req: Request)
async fn write_request(&self, req: Request)
Source§impl RequestWriter for BidirectionalWriter<UnboundedSender<BidirectionalMessage>>
impl RequestWriter for BidirectionalWriter<UnboundedSender<BidirectionalMessage>>
Source§async fn write_request(&self, req: Request)
async fn write_request(&self, req: Request)
Source§impl ResponseWriter for BidirectionalWriter<Sender<BidirectionalMessage>>
impl ResponseWriter for BidirectionalWriter<Sender<BidirectionalMessage>>
Source§async fn write_response(&self, res: Response)
async fn write_response(&self, res: Response)
Source§impl ResponseWriter for BidirectionalWriter<UnboundedSender<BidirectionalMessage>>
impl ResponseWriter for BidirectionalWriter<UnboundedSender<BidirectionalMessage>>
Source§async fn write_response(&self, res: Response)
async fn write_response(&self, res: Response)
Auto Trait Implementations§
impl<S> Freeze for BidirectionalWriter<S>where
S: Freeze,
impl<S> RefUnwindSafe for BidirectionalWriter<S>where
S: RefUnwindSafe,
impl<S> Send for BidirectionalWriter<S>where
S: Send,
impl<S> Sync for BidirectionalWriter<S>where
S: Sync,
impl<S> Unpin for BidirectionalWriter<S>where
S: Unpin,
impl<S> UnwindSafe for BidirectionalWriter<S>where
S: 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<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