Expand description
A wrapper around a DER value
Fields
data: Vec<u8>
The value
Implementations
sourceimpl DerValue
impl DerValue
sourcepub fn deserialize<'a>(
source: impl Iterator<Item = &'a u8>,
len: impl Into<usize>
) -> Result<Self, Asn1DerError>
pub fn deserialize<'a>(
source: impl Iterator<Item = &'a u8>,
len: impl Into<usize>
) -> Result<Self, Asn1DerError>
DER-deserializes the data from source
sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
The length of the DER-serialized representation of self
sourcepub fn serialize<'a>(
&self,
buf: impl Iterator<Item = &'a mut u8>
) -> Result<usize, Asn1DerError>
pub fn serialize<'a>(
&self,
buf: impl Iterator<Item = &'a mut u8>
) -> Result<usize, Asn1DerError>
DER-serializes self
into buf
and returns the amount of bytes written
sourcepub fn compute_serialized_len(payload_len: usize) -> usize
pub fn compute_serialized_len(payload_len: usize) -> usize
Efficiently computes the length of the DER-serialized representation of payload_len
bytes
Trait Implementations
impl Eq for DerValue
impl StructuralEq for DerValue
impl StructuralPartialEq for DerValue
Auto Trait Implementations
impl RefUnwindSafe for DerValue
impl Send for DerValue
impl Sync for DerValue
impl Unpin for DerValue
impl UnwindSafe for DerValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more