pub struct Writer {
backend: Box<dyn Write + Send>,
}
Expand description
A low-level writer type, wrapping a boxed Write
.
It enforces the property that outbound requests are syntactically well-formed.
Fields§
§backend: Box<dyn Write + Send>
The underlying writer.
Implementations§
Source§impl Writer
impl Writer
Sourcepub fn send_request(&mut self, request: &str) -> Result<(), SendRequestError>
pub fn send_request(&mut self, request: &str) -> Result<(), SendRequestError>
Send an outbound request.
Return an error if an IO problems occurred, or if the request was not well-formed.
Sourcepub(crate) fn send_valid(&mut self, request: &ValidatedRequest) -> Result<()>
pub(crate) fn send_valid(&mut self, request: &ValidatedRequest) -> Result<()>
Crate-internal: Send a request that is known to be valid.
(This is reliable since we never construct a ValidRequest
except by encoding a
known-correct object.)
Auto Trait Implementations§
impl Freeze for Writer
impl !RefUnwindSafe for Writer
impl Send for Writer
impl !Sync for Writer
impl Unpin for Writer
impl !UnwindSafe for Writer
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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