pub struct DerObject<'a> { /* private fields */ }
Expand description
An untyped DER object
Implementations§
source§impl<'a> DerObject<'a>
impl<'a> DerObject<'a>
sourcepub fn new<S: Sink + Into<&'a [u8]>>(
tag: u8,
value: &[u8],
sink: S
) -> Result<Self, Asn1DerError>
pub fn new<S: Sink + Into<&'a [u8]>>( tag: u8, value: &[u8], sink: S ) -> Result<Self, Asn1DerError>
Writes a new DER object with tag
and value
into sink
and returns a view over it
sourcepub fn new_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
tag: u8,
len: usize,
value: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
pub fn new_from_source<A: Source, B: Sink + Into<&'a [u8]>>( tag: u8, len: usize, value: &mut A, sink: B ) -> Result<Self, Asn1DerError>
Writes a new DER object with tag
, len
and value
into sink
and returns a view over it
sourcepub fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>
pub fn decode(raw: &'a [u8]) -> Result<Self, Asn1DerError>
Decodes an object from raw
sourcepub fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
source: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
pub fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>( source: &mut A, sink: B ) -> Result<Self, Asn1DerError>
Reads a DER-TLV structure from source
by parsing the length field and copying the
necessary bytes into sink
and returns a view over it
Trait Implementations§
source§impl<'a> DerDecodable<'a> for DerObject<'a>
impl<'a> DerDecodable<'a> for DerObject<'a>
source§fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>
fn decode_at(raw: &'a [u8], header_start: usize) -> Result<Self, Asn1DerError>
Decodes an object as
Self
source§fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>(
source: &mut A,
sink: B
) -> Result<Self, Asn1DerError>
fn decode_from_source<A: Source, B: Sink + Into<&'a [u8]>>( source: &mut A, sink: B ) -> Result<Self, Asn1DerError>
Reads an object from
source
by parsing the length field and copying the necessary bytes
into sink
and decoding it from sink
source§impl<'a> DerEncodable for DerObject<'a>
impl<'a> DerEncodable for DerObject<'a>
impl<'a> Copy for DerObject<'a>
Auto Trait Implementations§
impl<'a> RefUnwindSafe for DerObject<'a>
impl<'a> Send for DerObject<'a>
impl<'a> Sync for DerObject<'a>
impl<'a> Unpin for DerObject<'a>
impl<'a> UnwindSafe for DerObject<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more