pub struct SetOf<T> { /* private fields */ }
Expand description

The SET OF object is an unordered list of homogeneous types.

Examples

use asn1_rs::SetOf;
use std::iter::FromIterator;

// build set
let it = [2, 3, 4].iter();
let set = SetOf::from_iter(it);

// `set` now contains the serialized DER representation of the array

// iterate objects
let mut sum = 0;
for item in set.iter() {
    // item has type `Result<u32>`, since parsing the serialized bytes could fail
    sum += *item;
}
assert_eq!(sum, 9);

Implementations

Builds a SET OF from the provided content

Returns the length of this SET (the number of items).

Returns true if this SET is empty.

Returns an iterator over the items of the SET.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Creates a value from an iterator. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Get the length of the object, when encoded Read more

Attempt to write the DER header to this writer.

Attempt to write the DER content (all except header) to this writer.

Write the DER encoded representation to a newly allocated 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

Attempt to write the DER encoded representation (header and content) into this writer. Read more

Similar to using to_der, but uses provided values without changes. This can generate an invalid encoding for a DER object. Read more

The type returned in the event of a conversion error.

Performs the conversion.

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 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.