Trait der::Encodable [−][src]
pub trait Encodable {
fn encoded_len(&self) -> Result<Length>;
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>;
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]> { ... }
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length> { ... }
fn to_vec(&self) -> Result<Vec<u8>> { ... }
}Expand description
Encoding trait.
Required methods
fn encoded_len(&self) -> Result<Length>[src]
Expand description
Compute the length of this value in bytes when encoded as ASN.1 DER.
fn encode(&self, encoder: &mut Encoder<'_>) -> Result<()>[src]
Expand description
Encode this value as ASN.1 DER using the provided Encoder.
Provided methods
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>[src]
Expand description
Encode this value to the provided byte slice, returning a sub-slice containing the encoded message.
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length>[src]
This is supported on crate feature
alloc only.Expand description
Encode this message as ASN.1 DER, appending it to the provided byte vector.
fn to_vec(&self) -> Result<Vec<u8>>[src]
This is supported on crate feature
alloc only.Expand description
Serialize this message as a byte vector.
Implementations on Foreign Types
impl Encodable for SystemTime[src]
impl Encodable for SystemTime[src]This is supported on crate feature
std only.impl<'a, T> Encodable for BTreeSet<T> where
T: Clone + Decodable<'a> + Encodable + Ord, [src]
impl<'a, T> Encodable for BTreeSet<T> where
T: Clone + Decodable<'a> + Encodable + Ord, [src]This is supported on crate feature
alloc only.Implementors
impl Encodable for GeneralizedTime[src]
impl Encodable for GeneralizedTime[src]impl Encodable for ObjectIdentifier[src]
impl Encodable for ObjectIdentifier[src]impl<'a> Encodable for OctetString<'a>[src]
impl<'a> Encodable for OctetString<'a>[src]impl<'a> Encodable for PrintableString<'a>[src]
impl<'a> Encodable for PrintableString<'a>[src]impl<'a> Encodable for Utf8String<'a>[src]
impl<'a> Encodable for Utf8String<'a>[src]