Trait transformable::Transformable
source · pub trait Transformable: Send + Sync + 'static {
type Error: Error + Send + Sync + 'static;
// Required methods
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>;
fn encoded_len(&self) -> usize;
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized;
// Provided methods
fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error> { ... }
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize> { ... }
fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> impl Future<Output = Result<usize>> + Send { ... }
fn decode_from_reader<R: Read>(reader: &mut R) -> Result<(usize, Self)>
where Self: Sized { ... }
fn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
reader: &mut R
) -> impl Future<Output = Result<(usize, Self)>> + Send
where Self: Sized { ... }
}
Available on crate feature
std
only.Expand description
The type can transform its representation between structured and byte form.
Required Associated Types§
Required Methods§
sourcefn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Encodes the value into the given buffer for transmission.
Returns the number of bytes written to the buffer.
sourcefn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the value. This is used to pre-allocate a buffer for encoding.
Provided Methods§
sourcefn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>
fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>
Encodes the value into a vec for transmission.
sourcefn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Encodes the value into the given writer for transmission.
sourcefn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> impl Future<Output = Result<usize>> + Send
Available on crate feature async
only.
fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> impl Future<Output = Result<usize>> + Send
async
only.Encodes the value into the given async writer for transmission.
sourcefn decode_from_reader<R: Read>(reader: &mut R) -> Result<(usize, Self)>where
Self: Sized,
fn decode_from_reader<R: Read>(reader: &mut R) -> Result<(usize, Self)>where
Self: Sized,
Decodes the value from the given reader received over the wire.
Returns the number of bytes read from the reader and the struct.
sourcefn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
reader: &mut R
) -> impl Future<Output = Result<(usize, Self)>> + Sendwhere
Self: Sized,
Available on crate feature async
only.
fn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
reader: &mut R
) -> impl Future<Output = Result<(usize, Self)>> + Sendwhere
Self: Sized,
async
only.Decodes the value from the given async reader received over the wire.
Returns the number of bytes read from the reader and the struct.
Object Safety§
This trait is not object safe.
Implementations on Foreign Types§
source§impl Transformable for IpAddr
impl Transformable for IpAddr
§type Error = IpAddrTransformError
type Error = IpAddrTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for SocketAddr
impl Transformable for SocketAddr
§type Error = SocketAddrTransformError
type Error = SocketAddrTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for i8
impl Transformable for i8
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for i16
impl Transformable for i16
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for i32
impl Transformable for i32
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for i64
impl Transformable for i64
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for i128
impl Transformable for i128
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for u8
impl Transformable for u8
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for u16
impl Transformable for u16
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for u32
impl Transformable for u32
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for u64
impl Transformable for u64
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for u128
impl Transformable for u128
§type Error = NumberTransformError
type Error = NumberTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Box<str>
impl Transformable for Box<str>
§type Error = StringTransformError
type Error = StringTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Box<[u8]>
impl Transformable for Box<[u8]>
§type Error = BytesTransformError
type Error = BytesTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for String
impl Transformable for String
§type Error = StringTransformError
type Error = StringTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Arc<str>
impl Transformable for Arc<str>
§type Error = StringTransformError
type Error = StringTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Arc<[u8]>
impl Transformable for Arc<[u8]>
§type Error = BytesTransformError
type Error = BytesTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Vec<u8>
impl Transformable for Vec<u8>
source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature std
only.
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
Available on crate features std
and async
only.
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
std
and async
only.source§fn decode_from_reader<R: Read>(src: &mut R) -> Result<(usize, Self)>where
Self: Sized,
Available on crate feature std
only.
fn decode_from_reader<R: Read>(src: &mut R) -> Result<(usize, Self)>where
Self: Sized,
std
only.source§async fn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
src: &mut R
) -> Result<(usize, Self)>where
Self: Sized,
Available on crate features std
and async
only.
async fn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
src: &mut R
) -> Result<(usize, Self)>where
Self: Sized,
std
and async
only.§type Error = BytesTransformError
type Error = BytesTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§impl Transformable for Ipv4Addr
impl Transformable for Ipv4Addr
§type Error = AddrTransformError
type Error = AddrTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Ipv6Addr
impl Transformable for Ipv6Addr
§type Error = AddrTransformError
type Error = AddrTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for SocketAddrV4
impl Transformable for SocketAddrV4
§type Error = AddrTransformError
type Error = AddrTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for SocketAddrV6
impl Transformable for SocketAddrV6
§type Error = AddrTransformError
type Error = AddrTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Duration
impl Transformable for Duration
§type Error = DurationTransformError
type Error = DurationTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Instant
impl Transformable for Instant
§type Error = InstantTransformError
type Error = InstantTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for SystemTime
impl Transformable for SystemTime
§type Error = SystemTimeTransformError
type Error = SystemTimeTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, writer: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
writer: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, writer: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for Bytes
impl Transformable for Bytes
§type Error = BytesTransformError
type Error = BytesTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl Transformable for SmolStr
impl Transformable for SmolStr
§type Error = StringTransformError
type Error = StringTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.source§impl<const N: usize> Transformable for SmallVec<[u8; N]>
impl<const N: usize> Transformable for SmallVec<[u8; N]>
source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature std
only.
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
Available on crate features std
and async
only.
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
std
and async
only.source§fn decode_from_reader<R: Read>(src: &mut R) -> Result<(usize, Self)>where
Self: Sized,
Available on crate feature std
only.
fn decode_from_reader<R: Read>(src: &mut R) -> Result<(usize, Self)>where
Self: Sized,
std
only.source§async fn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
src: &mut R
) -> Result<(usize, Self)>where
Self: Sized,
Available on crate features std
and async
only.
async fn decode_from_async_reader<R: AsyncRead + Send + Unpin>(
src: &mut R
) -> Result<(usize, Self)>where
Self: Sized,
std
and async
only.§type Error = BytesTransformError
type Error = BytesTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§impl<const N: usize> Transformable for [u8; N]
impl<const N: usize> Transformable for [u8; N]
§type Error = BytesTransformError
type Error = BytesTransformError
Available on crate feature
std
only.source§fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
fn encode(&self, dst: &mut [u8]) -> Result<usize, Self::Error>
Available on crate feature
std
only.source§fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
fn encode_to_writer<W: Write>(&self, dst: &mut W) -> Result<usize>
Available on crate feature
std
only.source§async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>(
&self,
dst: &mut W
) -> Result<usize>
async fn encode_to_async_writer<W: AsyncWrite + Send + Unpin>( &self, dst: &mut W ) -> Result<usize>
Available on crate features
std
and async
only.source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Available on crate feature
std
only.source§fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>where
Self: Sized,
Available on crate feature
std
only.