Trait rocket::mtls::x509::der_parser::asn1_rs::DerAutoDerive

source ·
pub trait DerAutoDerive { }
Available on crate feature mtls only.
Expand description

Trait to automatically derive FromDer

This trait is only a marker to control if a DER parser should be automatically derived. It is empty.

This trait is used in combination with others: after implementing TryFrom<Any> and CheckDerConstraints for a type, a free FromDer implementation is provided by implementing the DerAutoDerive trait. This is the most common case.

However, this is not automatic so it is also possible to manually implement FromDer if preferred. Manual implementation is generally only needed for generic containers (for ex. Vec<T>), because the default implementation adds a constraint on T to implement also TryFrom<Any> and CheckDerConstraints. This is problematic when T only provides FromDer, and can be solved by providing a manual implementation of FromDer.

Implementations on Foreign Types§

source§

impl DerAutoDerive for &str

source§

impl DerAutoDerive for &[u8]

source§

impl DerAutoDerive for bool

source§

impl DerAutoDerive for f32

source§

impl DerAutoDerive for f64

source§

impl DerAutoDerive for i8

source§

impl DerAutoDerive for i16

source§

impl DerAutoDerive for i32

source§

impl DerAutoDerive for i64

source§

impl DerAutoDerive for i128

source§

impl DerAutoDerive for u8

source§

impl DerAutoDerive for u16

source§

impl DerAutoDerive for u32

source§

impl DerAutoDerive for u64

source§

impl DerAutoDerive for u128

source§

impl DerAutoDerive for ()

Implementors§