Struct asn1_der::typed::Integer

source ·
pub struct Integer<'a> { /* private fields */ }
Expand description

An ASN.1-DER integer view

Implementations§

Writes a new integer object with the big-endian encoded be_value into sink and returns a type view over it

Returns if the number is negative or not

Get the number bytes

Important: Any leading zero-byte that might indicate a positive number is stripped off. This means that a return value of 0b1111_1111 can be either 255 or -1 depending on whether the number is negative or not. Use is_negative to determine the correct sign.

Copies the num bytes into buf if they can fit

Important: Any leading zero-byte that might indicate a positive number is stripped off. This means that a return value of 0b1111_1111 can be either 255 or -1 depending on whether the number is negative or not. Use is_negative to determine the correct sign.

Writes an integer value as DER-object to sink

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Loads object as Self
Decodes an object as Self
Decodes an object as Self
Reads an object from source by parsing the length field and copying the necessary bytes into sink and decoding it from sink Read more

Encodes self to sink

Creates an DER object from an encodable type
The tag for this type
Provides raw access to the underlying DerObject

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.