Trait asn1_cereal::ber::serial::traits::BerSerialize [] [src]

pub trait BerSerialize: Asn1Info {
    fn serialize_value<E: BerEncRules, W: Write>(&self, e: E, writer: &mut W) -> Result<()EncodeError>;

    fn serialize<W: Write>(&self, writer: &mut W) -> Result<()EncodeError> { ... }
    fn serialize_enc<E: BerEncRules, W: Write>(&self, e: E, writer: &mut W) -> Result<()EncodeError> { ... }
    fn _serialize_enc<E: BerEncRules, W: Write>(&self, e: E, writer: &mut W) -> Option<Result<()EncodeError>> { ... }
}

Provides the methods required to serialize this Rust type into an ASN.1 stream.

When implementing this for a simple primitive type, implementing serialize_value should be all that's required. For more complex, structured types you may need to implement _serialize_enc (this is called first by serialize_enc).

Required Methods

Serialise a value into ASN.1 data, without a tag (implicit tagging).

Provided Methods

Serialize a value into ASN.1 data as DER.

Serialize a value into ASN.1 data using a specific set of encoding rules.

An empty method that is called first by serialize_enc to allow custom handling, without losing normal serialization behaviour.

Return Some(()) to indicate stop normal behaviour, or None to continue.

Implementors