Trait sequoia_openpgp::serialize::Marshal[][src]

pub trait Marshal: Sealed {
    fn serialize(&self, o: &mut dyn Write) -> Result<()>;

    fn export(&self, o: &mut dyn Write) -> Result<()> { ... }
}

Serializes OpenPGP data structures.

This trait provides the same interface as Serialize, but is implemented for all data structures that can be serialized.

In general, you should prefer the Serialize trait, as it is only implemented for data structures that are normally exported. See the documentation for Serialize for more details.

Sealed trait

This trait is sealed and cannot be implemented for types outside this crate. Therefore it can be extended in a non-breaking way. If you want to implement the trait inside the crate you also need to implement the seal::Sealed marker trait.

Required methods

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the object to o.

Loading content...

Provided methods

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

Exports a serialized version of the object to o.

This is similar to serialize(..), with these exceptions:

  • It is an error to export a Signature if it is marked as non-exportable.
  • When exporting a Cert, non-exportable signatures are not exported, and any component bound merely by non-exportable signatures is not exported.
Loading content...

Implementors

impl Marshal for S2K[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for Ciphertext[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for PublicKey[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for SecretKeyMaterial[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for sequoia_openpgp::crypto::mpi::Signature[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for Fingerprint[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for KeyID[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Packet[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified Packet to o.

This function works recursively: if the packet contains any packets, they are also serialized.

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

Exports a serialized version of the specified Packet to o.

This function works recursively: if the packet contains any packets, they are also serialized.

impl Marshal for AED[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for OnePassSig[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for PKESK[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for SEIP[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified SEIP packet to o.

Errors

Returns Error::InvalidOperation if this packet has children. To construct an encrypted message, use serialize::stream::Encryptor.

impl Marshal for SKESK[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for sequoia_openpgp::packet::Signature[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for BodyLength[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Emits the length encoded for use with new-style CTBs.

Note: the CTB itself is not emitted.

Errors

Returns Error::InvalidArgument if invoked on BodyLength::Indeterminate. If you want to serialize an old-style length, use serialize_old(..).

impl Marshal for CTB[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for SubpacketValue[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Image[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for sequoia_openpgp::packet::user_attribute::Subpacket[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for MPI[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for ProtectedMPI[src]

fn serialize(&self, w: &mut dyn Write) -> Result<()>[src]

impl Marshal for AED1[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified AED packet to o.

Errors

Returns Error::InvalidOperation if this packet has children. To construct an encrypted message, use serialize::stream::Encryptor.

impl Marshal for CTBNew[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for CTBOld[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Header[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for OnePassSig3[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for PKESK3[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for CompressedData[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified CompressedData packet to o.

This function works recursively: if the CompressedData packet contains any packets, they are also serialized.

impl Marshal for Literal[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for MDC[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Marker[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Trust[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Unknown[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for UserID[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Signature4[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified Signature packet to o.

Errors

Returns Error::InvalidArgument if either the hashed-area or the unhashed-area exceeds the size limit of 2^16.

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for sequoia_openpgp::packet::signature::subpacket::Subpacket[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for SubpacketArea[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for SKESK4[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for SKESK5[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for UserAttribute[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Cert[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

impl Marshal for Message[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified Message to o.

impl Marshal for PacketPile[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Writes a serialized version of the specified PacketPile to o.

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

Exports a serialized version of the specified PacketPile to o.

impl Marshal for RevocationKey[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl<'a> Marshal for TSK<'a>[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

fn export(&self, o: &mut dyn Write) -> Result<()>[src]

impl<P, R> Marshal for Key4<P, R> where
    P: KeyParts,
    R: KeyRole
[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

impl<P: KeyParts, R: KeyRole> Marshal for Key<P, R>[src]

fn serialize(&self, o: &mut dyn Write) -> Result<()>[src]

Loading content...