pub trait U128Ext {
fn usize(self) -> Result<usize, Asn1DerError>;
fn u64(self) -> Result<u64, Asn1DerError>;
fn u32(self) -> Result<u32, Asn1DerError>;
fn u16(self) -> Result<u16, Asn1DerError>;
fn u8(self) -> Result<u8, Asn1DerError>;
}
Expand description
An extension that allows you to safely convert a u128
to a smaller type
Required methods
fn usize(self) -> Result<usize, Asn1DerError>
fn usize(self) -> Result<usize, Asn1DerError>
Converts self
or returns Asn1DerError::Unsupported
if self
is too large
fn u64(self) -> Result<u64, Asn1DerError>
fn u64(self) -> Result<u64, Asn1DerError>
Converts self
or returns Asn1DerError::Unsupported
if self
is too large
fn u32(self) -> Result<u32, Asn1DerError>
fn u32(self) -> Result<u32, Asn1DerError>
Converts self
or returns Asn1DerError::Unsupported
if self
is too large
fn u16(self) -> Result<u16, Asn1DerError>
fn u16(self) -> Result<u16, Asn1DerError>
Converts self
or returns Asn1DerError::Unsupported
if self
is too large
fn u8(self) -> Result<u8, Asn1DerError>
fn u8(self) -> Result<u8, Asn1DerError>
Converts self
or returns Asn1DerError::Unsupported
if self
is too large