Transformable

Trait 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>(&self, writer: &mut W) -> Result<usize, Error>
       where W: Write { ... }
    fn encode_to_async_writer<W>(
        &self,
        writer: &mut W,
    ) -> impl Future<Output = Result<usize, Error>> + Send
       where W: AsyncWrite + Send + Unpin { ... }
    fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, Self), Error>
       where R: Read,
             Self: Sized { ... }
    fn decode_from_async_reader<R>(
        reader: &mut R,
    ) -> impl Future<Output = Result<(usize, Self), Error>> + Send
       where R: AsyncRead + Send + Unpin,
             Self: Sized { ... }
}
Expand description

The type can transform its representation between structured and byte form.

Required Associated Types§

Source

type Error: Error + Send + Sync + 'static

The error type returned when encoding or decoding fails.

Required Methods§

Source

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.

Source

fn encoded_len(&self) -> usize

Returns the encoded length of the value. This is used to pre-allocate a buffer for encoding.

Source

fn decode(src: &[u8]) -> Result<(usize, Self), Self::Error>
where Self: Sized,

Decodes the value from the given buffer received over the wire.

Returns the number of bytes read from the buffer and the struct.

Provided Methods§

Source

fn encode_to_vec(&self) -> Result<Vec<u8>, Self::Error>

Encodes the value into a vec for transmission.

Source

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Encodes the value into the given writer for transmission.

Source

fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> impl Future<Output = Result<usize, Error>> + Send
where W: AsyncWrite + Send + Unpin,

Encodes the value into the given async writer for transmission.

Source

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, Self), Error>
where R: Read, 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.

Source

fn decode_from_async_reader<R>( reader: &mut R, ) -> impl Future<Output = Result<(usize, Self), Error>> + Send
where R: AsyncRead + Send + Unpin, Self: Sized,

Decodes the value from the given async reader received over the wire.

Returns the number of bytes read from the reader and the struct.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Transformable for IpAddr

Source§

type Error = IpAddrTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <IpAddr as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, IpAddr), <IpAddr as Transformable>::Error>
where IpAddr: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, IpAddr), Error>
where R: Read, IpAddr: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, IpAddr), Error>
where R: AsyncRead + Send + Unpin, IpAddr: Sized,

Source§

impl Transformable for SocketAddr

Source§

impl Transformable for SecretKey

Source§

impl Transformable for i8

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <i8 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, i8), <i8 as Transformable>::Error>
where i8: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, i8), Error>
where R: Read, i8: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, i8), Error>
where R: AsyncRead + Send + Unpin, i8: Sized,

Source§

impl Transformable for i16

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <i16 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, i16), <i16 as Transformable>::Error>
where i16: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, i16), Error>
where R: Read, i16: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, i16), Error>
where R: AsyncRead + Send + Unpin, i16: Sized,

Source§

impl Transformable for i32

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <i32 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, i32), <i32 as Transformable>::Error>
where i32: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, i32), Error>
where R: Read, i32: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, i32), Error>
where R: AsyncRead + Send + Unpin, i32: Sized,

Source§

impl Transformable for i64

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <i64 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, i64), <i64 as Transformable>::Error>
where i64: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, i64), Error>
where R: Read, i64: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, i64), Error>
where R: AsyncRead + Send + Unpin, i64: Sized,

Source§

impl Transformable for i128

Source§

type Error = NumberTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <i128 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, i128), <i128 as Transformable>::Error>
where i128: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, i128), Error>
where R: Read, i128: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, i128), Error>
where R: AsyncRead + Send + Unpin, i128: Sized,

Source§

impl Transformable for u8

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <u8 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, u8), <u8 as Transformable>::Error>
where u8: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, u8), Error>
where R: Read, u8: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, u8), Error>
where R: AsyncRead + Send + Unpin, u8: Sized,

Source§

impl Transformable for u16

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <u16 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, u16), <u16 as Transformable>::Error>
where u16: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, u16), Error>
where R: Read, u16: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, u16), Error>
where R: AsyncRead + Send + Unpin, u16: Sized,

Source§

impl Transformable for u32

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <u32 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, u32), <u32 as Transformable>::Error>
where u32: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, u32), Error>
where R: Read, u32: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, u32), Error>
where R: AsyncRead + Send + Unpin, u32: Sized,

Source§

impl Transformable for u64

Source§

type Error = NumberTransformError

Source§

fn encode(&self, dst: &mut [u8]) -> Result<usize, <u64 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, u64), <u64 as Transformable>::Error>
where u64: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, u64), Error>
where R: Read, u64: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, u64), Error>
where R: AsyncRead + Send + Unpin, u64: Sized,

Source§

impl Transformable for u128

Source§

type Error = NumberTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <u128 as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, u128), <u128 as Transformable>::Error>
where u128: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, u128), Error>
where R: Read, u128: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, u128), Error>
where R: AsyncRead + Send + Unpin, u128: Sized,

Source§

impl Transformable for Box<str>

Source§

type Error = StringTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Box<str> as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Box<str>), <Box<str> as Transformable>::Error>
where Box<str>: Sized,

Source§

fn decode_from_reader<R>(src: &mut R) -> Result<(usize, Box<str>), Error>
where R: Read, Box<str>: Sized,

Source§

async fn decode_from_async_reader<R>( src: &mut R, ) -> Result<(usize, Box<str>), Error>
where R: AsyncRead + Send + Unpin, Box<str>: Sized,

Source§

impl Transformable for Box<[u8]>

Source§

type Error = BytesTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Box<[u8]> as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Box<[u8]>), <Box<[u8]> as Transformable>::Error>
where Box<[u8]>: Sized,

Source§

fn decode_from_reader<R>(src: &mut R) -> Result<(usize, Box<[u8]>), Error>
where R: Read, Box<[u8]>: Sized,

Source§

async fn decode_from_async_reader<R>( src: &mut R, ) -> Result<(usize, Box<[u8]>), Error>
where R: AsyncRead + Send + Unpin, Box<[u8]>: Sized,

Source§

impl Transformable for String

Source§

impl Transformable for Arc<str>

Source§

type Error = StringTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Arc<str> as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Arc<str>), <Arc<str> as Transformable>::Error>
where Arc<str>: Sized,

Source§

fn decode_from_reader<R>(src: &mut R) -> Result<(usize, Arc<str>), Error>
where R: Read, Arc<str>: Sized,

Source§

async fn decode_from_async_reader<R>( src: &mut R, ) -> Result<(usize, Arc<str>), Error>
where R: AsyncRead + Send + Unpin, Arc<str>: Sized,

Source§

impl Transformable for Arc<[u8]>

Source§

type Error = BytesTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Arc<[u8]> as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Arc<[u8]>), <Arc<[u8]> as Transformable>::Error>
where Arc<[u8]>: Sized,

Source§

fn decode_from_reader<R>(src: &mut R) -> Result<(usize, Arc<[u8]>), Error>
where R: Read, Arc<[u8]>: Sized,

Source§

async fn decode_from_async_reader<R>( src: &mut R, ) -> Result<(usize, Arc<[u8]>), Error>
where R: AsyncRead + Send + Unpin, Arc<[u8]>: Sized,

Source§

impl Transformable for Vec<u8>

Source§

fn encode_to_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: Write,

Encodes the value into the given writer.

§Note

The implementation of this method is not optimized, which means if your writer is expensive (e.g. TcpStream, File), it is better to use a BufWriter to wrap your orginal writer to cut down the number of I/O times.

Source§

async fn encode_to_async_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Encodes the value into the given async writer.

§Note

The implementation of this method is not optimized, which means if your writer is expensive (e.g. TcpStream, File), it is better to use a BufWriter to wrap your orginal writer to cut down the number of I/O times.

Source§

fn decode_from_reader<R>(src: &mut R) -> Result<(usize, Vec<u8>), Error>
where R: Read, Vec<u8>: Sized,

Decodes the value from the given reader.

§Note

The implementation of this method is not optimized, which means if your reader is expensive (e.g. TcpStream, File), it is better to use a BufReader to wrap your orginal reader to cut down the number of I/O times.

Source§

async fn decode_from_async_reader<R>( src: &mut R, ) -> Result<(usize, Vec<u8>), Error>
where R: AsyncRead + Send + Unpin, Vec<u8>: Sized,

Decodes the value from the given async reader.

§Note

The implementation of this method is not optimized, which means if your reader is expensive (e.g. TcpStream, File), it is better to use a BufReader to wrap your orginal reader to cut down the number of I/O times.

Source§

type Error = BytesTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Vec<u8> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Vec<u8>), <Vec<u8> as Transformable>::Error>
where Vec<u8>: Sized,

Source§

impl Transformable for Ipv4Addr

Source§

impl Transformable for Ipv6Addr

Source§

impl Transformable for SocketAddrV4

Source§

impl Transformable for SocketAddrV6

Source§

impl Transformable for Duration

Source§

impl Transformable for Instant

Source§

type Error = InstantTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Instant as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin, <Instant as Transformable>::Error: Send + Sync + 'static,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Instant), <Instant as Transformable>::Error>
where Instant: Sized,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, Instant), Error>
where R: Read, Instant: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, Instant), Error>
where R: AsyncRead + Send + Unpin, Instant: Sized, <Instant as Transformable>::Error: Send + Sync + 'static,

Source§

impl Transformable for SystemTime

Source§

impl Transformable for Bytes

Source§

impl Transformable for Ack

Source§

impl Transformable for Nack

Source§

type Error = <u32 as Transformable>::Error

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Nack as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, Nack), <Nack as Transformable>::Error>
where Nack: Sized,

Source§

async fn encode_to_async_writer<W>( &self, writer: &mut W, ) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encode_to_writer<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Source§

fn decode_from_reader<R>(reader: &mut R) -> Result<(usize, Nack), Error>
where R: Read, Nack: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, Nack), Error>
where R: AsyncRead + Send + Unpin, Nack: Sized,

Source§

impl Transformable for ErrorResponse

Source§

impl Transformable for Meta

Source§

type Error = MetaError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Meta as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode(src: &[u8]) -> Result<(usize, Meta), <Meta as Transformable>::Error>
where Meta: Sized,

Source§

impl Transformable for SecretKeys

Source§

impl Transformable for SmolStr

Source§

impl<I> Transformable for Dead<I>
where I: Transformable,

Source§

type Error = DeadTransformError<I>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Dead<I> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Dead<I>), <Dead<I> as Transformable>::Error>
where Dead<I>: Sized,

Source§

impl<I> Transformable for Suspect<I>
where I: Transformable,

Source§

type Error = SuspectTransformError<I>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Suspect<I> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Suspect<I>), <Suspect<I> as Transformable>::Error>
where Suspect<I>: Sized,

Source§

impl<I, A> Transformable for Message<I, A>

Source§

type Error = MessageTransformError<I, A>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Message<I, A> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Message<I, A>), <Message<I, A> as Transformable>::Error>
where Message<I, A>: Sized,

Source§

fn decode_from_reader<R>( reader: &mut R, ) -> Result<(usize, Message<I, A>), Error>
where R: Read, Message<I, A>: Sized,

Source§

async fn decode_from_async_reader<R>( reader: &mut R, ) -> Result<(usize, Message<I, A>), Error>
where R: AsyncRead + Send + Unpin, Message<I, A>: Sized,

Source§

impl<I, A> Transformable for Alive<I, A>
where I: Transformable + 'static, A: Transformable + 'static,

Source§

type Error = AliveTransformError<I, A>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Alive<I, A> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Alive<I, A>), <Alive<I, A> as Transformable>::Error>
where Alive<I, A>: Sized,

Source§

impl<I, A> Transformable for IndirectPing<I, A>

Source§

type Error = IndirectPingTransformError<I, A>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <IndirectPing<I, A> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, IndirectPing<I, A>), <IndirectPing<I, A> as Transformable>::Error>
where IndirectPing<I, A>: Sized,

Source§

impl<I, A> Transformable for Ping<I, A>

Source§

type Error = PingTransformError<I, A>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <Ping<I, A> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, Ping<I, A>), <Ping<I, A> as Transformable>::Error>
where Ping<I, A>: Sized,

Source§

impl<I, A> Transformable for PushNodeState<I, A>

Source§

type Error = PushPullTransformError<I, A>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <PushNodeState<I, A> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, PushNodeState<I, A>), <PushNodeState<I, A> as Transformable>::Error>
where PushNodeState<I, A>: Sized,

Source§

impl<I, A> Transformable for PushPull<I, A>

Source§

type Error = PushPullTransformError<I, A>

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <PushPull<I, A> as Transformable>::Error>

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, PushPull<I, A>), <PushPull<I, A> as Transformable>::Error>
where PushPull<I, A>: Sized,

Source§

impl<const N: usize> Transformable for [u8; N]

Source§

type Error = BytesTransformError

Source§

fn encode( &self, dst: &mut [u8], ) -> Result<usize, <[u8; N] as Transformable>::Error>

Source§

fn encode_to_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: Write,

Source§

async fn encode_to_async_writer<W>(&self, dst: &mut W) -> Result<usize, Error>
where W: AsyncWrite + Send + Unpin,

Source§

fn encoded_len(&self) -> usize

Source§

fn decode( src: &[u8], ) -> Result<(usize, [u8; N]), <[u8; N] as Transformable>::Error>
where [u8; N]: Sized,

Source§

fn decode_from_reader<R>(src: &mut R) -> Result<(usize, [u8; N]), Error>
where R: Read, [u8; N]: Sized,

Source§

async fn decode_from_async_reader<R>( src: &mut R, ) -> Result<(usize, [u8; N]), Error>
where R: AsyncRead + Send + Unpin, [u8; N]: Sized,

Implementors§

Source§

impl Transformable for KeyRequestMessage

Source§

impl Transformable for KeyResponseMessage

Source§

impl Transformable for LamportTime

Source§

impl Transformable for NodeAddress

Source§

impl Transformable for NodeId

Source§

impl Transformable for Tags

Source§

impl Transformable for UserEvent

Source§

impl Transformable for UserEventMessage

Source§

impl Transformable for UserEvents

Source§

impl<I> Transformable for Filter<I>
where I: Transformable,

Source§

impl<I> Transformable for JoinMessage<I>
where I: Transformable,

Source§

impl<I> Transformable for LeaveMessage<I>
where I: Transformable,

Source§

impl<I> Transformable for PushPullMessage<I>
where I: Transformable + Hash + Eq,

Source§

impl<I, A> Transformable for Member<I, A>

Source§

impl<I, A> Transformable for Node<I, A>

Source§

impl<I, A> Transformable for QueryMessage<I, A>

Source§

impl<I, A> Transformable for QueryResponseMessage<I, A>