pub enum Length {
Definite(usize),
Indefinite,
}
Expand description
BER Object Length
Variants
Definite(usize)
Definite form (X.690 8.1.3.3)
Indefinite
Indefinite form (X.690 8.1.3.6)
Implementations
sourceimpl Length
impl Length
sourcepub const fn is_definite(&self) -> bool
pub const fn is_definite(&self) -> bool
Return true if length is definite
sourcepub const fn assert_definite(&self) -> Result<()>
pub const fn assert_definite(&self) -> Result<()>
Return error if length is not definite
Trait Implementations
sourceimpl AddAssign<usize> for Length
impl AddAssign<usize> for Length
sourcefn add_assign(&mut self, rhs: usize)
fn add_assign(&mut self, rhs: usize)
Performs the +=
operation. Read more
sourceimpl ToDer for Length
impl ToDer for Length
sourcefn to_der_len(&self) -> Result<usize>
fn to_der_len(&self) -> Result<usize>
Get the length of the object, when encoded Read more
sourcefn write_der_header(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_header(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER header to this writer.
sourcefn write_der_content(&self, _writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_content(&self, _writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER content (all except header) to this writer.
sourcefn to_der_vec(&self) -> SerializeResult<Vec<u8>>
fn to_der_vec(&self) -> SerializeResult<Vec<u8>>
Write the DER encoded representation to a newly allocated Vec<u8>
.
sourcefn to_der_vec_raw(&self) -> SerializeResult<Vec<u8>>
fn to_der_vec_raw(&self) -> SerializeResult<Vec<u8>>
Similar to using to_vec
, but uses provided values without changes.
This can generate an invalid encoding for a DER object. Read more
sourcefn write_der(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Attempt to write the DER encoded representation (header and content) into this writer. Read more
sourcefn write_der_raw(&self, writer: &mut dyn Write) -> SerializeResult<usize>
fn write_der_raw(&self, writer: &mut dyn Write) -> SerializeResult<usize>
Similar to using to_der
, but uses provided values without changes.
This can generate an invalid encoding for a DER object. Read more
impl Copy for Length
impl Eq for Length
impl StructuralEq for Length
impl StructuralPartialEq for Length
Auto Trait Implementations
impl RefUnwindSafe for Length
impl Send for Length
impl Sync for Length
impl Unpin for Length
impl UnwindSafe for Length
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more