[][src]Trait sequoia_openpgp::serialize::SerializeInto

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

Serialization into pre-allocated buffers.

Required methods

fn serialized_len(&self) -> 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]) -> 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) -> Result<Vec<u8>>

Serializes the packet to a vector.

Loading content...

Implementors

impl SerializeInto for Ciphertext[src]

impl SerializeInto for PublicKey[src]

impl SerializeInto for SecretKey[src]

impl SerializeInto for sequoia_openpgp::crypto::mpis::Signature[src]

impl SerializeInto for S2K[src]

impl SerializeInto for Fingerprint[src]

impl SerializeInto for KeyID[src]

impl SerializeInto for Packet[src]

impl SerializeInto for CTB[src]

impl SerializeInto for BodyLength[src]

impl SerializeInto for SKESK[src]

impl SerializeInto for MPI[src]

impl SerializeInto for CTBNew[src]

impl SerializeInto for CTBOld[src]

impl SerializeInto for sequoia_openpgp::packet::signature::Signature[src]

impl SerializeInto for AED[src]

impl SerializeInto for CompressedData[src]

fn serialized_len(&self) -> usize[src]

Computes the maximal length of the serialized representation.

The size of the serialized compressed data packet is tricky to predict. First, it depends on the data being compressed. Second, we emit partial body encoded data.

This function tries overestimates the length. However, it may happen that serialize_into() fails.

Errors

If serialization would fail, this function returns 0.

fn to_vec(&self) -> Result<Vec<u8>>[src]

impl SerializeInto for Literal[src]

impl SerializeInto for MDC[src]

impl SerializeInto for OnePassSig[src]

impl SerializeInto for PKESK[src]

impl SerializeInto for SEIP[src]

impl SerializeInto for SKESK4[src]

impl SerializeInto for SKESK5[src]

impl SerializeInto for Unknown[src]

impl SerializeInto for UserID[src]

impl SerializeInto for UserAttribute[src]

impl SerializeInto for PacketPile[src]

impl<'a> SerializeInto for SubpacketValue<'a>[src]

impl<'a> SerializeInto for Subpacket<'a>[src]

Loading content...