Enum asn1_cereal::tag::Len
[−]
[src]
pub enum Len { Def(u64), Indef, }
An enum representing the length of an ASN.1 element.
Variants
Def(u64)
A Definite length element.
Indef
An Indefinite length element, not known before decoding.
Methods
impl Len
[src]
fn read_indef_end<I: Iterator<Item=Result<u8>>>(bytes: &mut I) -> Result<(), DecodeError>
Given an iterator, read an indefinite length terminator.
fn write_indef_end<W: Write>(writer: &mut W) -> Result<(), EncodeError>
Write an indefinite length terminator to the given writer.
fn read_len<I: Iterator<Item=Result<u8>>>(bytes: &mut I) -> Result<Self, DecodeError>
Given an iterator over a byte stream, read and return the ASN.1 element length.
fn write_len<W: Write>(self, writer: &mut W) -> Result<(), EncodeError>
Write this ASN.1 length to the given writer.
fn as_num(self) -> Option<LenNum>
A short-hand function to quickly get an Option
Trait Implementations
impl PartialEq for Len
[src]
fn eq(&self, __arg_0: &Len) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Len) -> bool
This method tests for !=
.
impl Debug for Len
[src]
impl Clone for Len
[src]
fn clone(&self) -> Len
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Len
[src]
impl From<Option<LenNum>> for Len
[src]
impl PartialOrd<Len> for Len
[src]
fn partial_cmp(&self, other: &Len) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl PartialEq<LenNum> for Len
[src]
fn eq(&self, other: &LenNum) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0
This method tests for !=
.
impl PartialOrd<LenNum> for Len
[src]
fn partial_cmp(&self, other: &LenNum) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more