[][src]Trait sequoia_openpgp::serialize::SerializeKeyInto

pub trait SerializeKeyInto {
    fn serialized_len(&self, tag: Tag) -> usize;
fn serialize_into(&self, buf: &mut [u8], tag: Tag) -> Result<usize>; fn to_vec(&self, tag: Tag) -> Result<Vec<u8>> { ... } }

Serialization into pre-allocated buffers.

Required methods

fn serialized_len(&self, tag: Tag) -> usize

Computes the maximal length of the serialized representation.

Errors

If serialization would fail, this function underestimates the length.

fn serialize_into(&self, buf: &mut [u8], tag: Tag) -> Result<usize>

Serializes into the given buffer.

Returns the length of the serialized representation.

Errors

If the length of the given slice is smaller than the maximal length computed by serialized_len(), this function returns Error::InvalidArgument.

Loading content...

Provided methods

fn to_vec(&self, tag: Tag) -> Result<Vec<u8>>

Serializes the packet to a vector.

Loading content...

Implementors

impl SerializeKeyInto for Key[src]

fn to_vec(&self, tag: Tag) -> Result<Vec<u8>>[src]

Loading content...