pub trait Serialize: Size {
    fn tls_serialize<W: Write>(&self, writer: &mut W) -> Result<usize, Error>;

    fn tls_serialize_detached(&self) -> Result<Vec<u8>, Error> { ... }
}
Expand description

The Serialize trait provides functions to serialize a struct or enum.

The trait provides two functions:

  • tls_serialize that takes a buffer to write the serialization to
  • tls_serialize_detached that returns a byte vector

Required methods

This is supported on crate feature std only.

Serialize self and write it to the writer. The function returns the number of bytes written to writer.

Provided methods

This is supported on crate feature std only.

Serialize self and return it as a byte vector.

Implementations on Foreign Types

This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.
This is supported on crate feature std only.

Implementors