pub struct DerLength {
pub len: usize,
}
Expand description
A wrapper around a DER length
Fields
len: usize
The length
Implementations
sourceimpl DerLength
impl DerLength
sourcepub fn deserialize<'a>(
source: impl Iterator<Item = &'a u8>
) -> Result<Self, Asn1DerError>
pub fn deserialize<'a>(
source: impl Iterator<Item = &'a u8>
) -> Result<Self, Asn1DerError>
DER-deserializes a length 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(len: usize) -> usize
pub fn compute_serialized_len(len: usize) -> usize
Efficiently computes the length of the DER-serialized representation of len
Trait Implementations
impl Copy for DerLength
impl Eq for DerLength
impl StructuralEq for DerLength
impl StructuralPartialEq for DerLength
Auto Trait Implementations
impl RefUnwindSafe for DerLength
impl Send for DerLength
impl Sync for DerLength
impl Unpin for DerLength
impl UnwindSafe for DerLength
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