pub struct TupleEncoder<'a, A, B> { /* private fields */ }Expand description
The encoder for a tuple of two data types.
Implementations§
Source§impl<'a, A, B> TupleEncoder<'a, A, B>
impl<'a, A, B> TupleEncoder<'a, A, B>
Source§impl<A, B> TupleEncoder<'_, A, B>
impl<A, B> TupleEncoder<'_, A, B>
Sourcepub fn encoded_len(&self) -> usize
pub fn encoded_len(&self) -> usize
Returns the encoded length of the data only considering the data itself, (e.g. no length prefix, no wire type).
Sourcepub fn encoded_len_with_length_delimited(&self) -> usize
pub fn encoded_len_with_length_delimited(&self) -> usize
Returns the encoded length of the data including the length delimited.
Sourcepub fn encode(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
pub fn encode(&self, buf: &mut [u8]) -> Result<usize, EncodeError>
Encodes the message to a buffer.
An error will be returned if the buffer does not have sufficient capacity.
Sourcepub fn encode_with_length_delimited(
&self,
buf: &mut [u8],
) -> Result<usize, EncodeError>
pub fn encode_with_length_delimited( &self, buf: &mut [u8], ) -> Result<usize, EncodeError>
Encodes the message with a length-delimiter to a buffer.
An error will be returned if the buffer does not have sufficient capacity.
Auto Trait Implementations§
impl<'a, A, B> Freeze for TupleEncoder<'a, A, B>
impl<'a, A, B> RefUnwindSafe for TupleEncoder<'a, A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<'a, A, B> Send for TupleEncoder<'a, A, B>
impl<'a, A, B> Sync for TupleEncoder<'a, A, B>
impl<'a, A, B> Unpin for TupleEncoder<'a, A, B>
impl<'a, A, B> UnwindSafe for TupleEncoder<'a, A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
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
Mutably borrows from an owned value. Read more
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> ⓘ
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