Struct der::asn1::SequenceOf
source · pub struct SequenceOf<T, const N: usize> { /* private fields */ }
Expand description
ASN.1 SEQUENCE OF
backed by an array.
This type implements an append-only SEQUENCE OF
type which is stack-based
and does not depend on alloc
support.
Implementations§
source§impl<T, const N: usize> SequenceOf<T, N>
impl<T, const N: usize> SequenceOf<T, N>
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new SequenceOf
.
sourcepub fn add(&mut self, element: T) -> Result<()>
pub fn add(&mut self, element: T) -> Result<()>
Add an element to this SequenceOf
.
sourcepub fn iter(&self) -> SequenceOfIter<'_, T> ⓘ
pub fn iter(&self) -> SequenceOfIter<'_, T> ⓘ
Iterate over the elements in this SequenceOf
.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Is this SequenceOf
empty?
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Number of elements in this SequenceOf
.
Trait Implementations§
source§impl<T: Clone, const N: usize> Clone for SequenceOf<T, N>
impl<T: Clone, const N: usize> Clone for SequenceOf<T, N>
source§fn clone(&self) -> SequenceOf<T, N>
fn clone(&self) -> SequenceOf<T, N>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, T, const N: usize> DecodeValue<'a> for SequenceOf<T, N>where
T: Decode<'a>,
impl<'a, T, const N: usize> DecodeValue<'a> for SequenceOf<T, N>where
T: Decode<'a>,
source§impl<T, const N: usize> Default for SequenceOf<T, N>
impl<T, const N: usize> Default for SequenceOf<T, N>
source§impl<T, const N: usize> EncodeValue for SequenceOf<T, N>where
T: Encode,
impl<T, const N: usize> EncodeValue for SequenceOf<T, N>where
T: Encode,
source§impl<T, const N: usize> FixedTag for SequenceOf<T, N>
impl<T, const N: usize> FixedTag for SequenceOf<T, N>
source§impl<T: PartialEq, const N: usize> PartialEq for SequenceOf<T, N>
impl<T: PartialEq, const N: usize> PartialEq for SequenceOf<T, N>
source§fn eq(&self, other: &SequenceOf<T, N>) -> bool
fn eq(&self, other: &SequenceOf<T, N>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq, const N: usize> Eq for SequenceOf<T, N>
impl<T, const N: usize> StructuralPartialEq for SequenceOf<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for SequenceOf<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for SequenceOf<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for SequenceOf<T, N>where
T: Send,
impl<T, const N: usize> Sync for SequenceOf<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for SequenceOf<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for SequenceOf<T, N>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
impl<'a, T> Decode<'a> for Twhere
T: DecodeValue<'a> + FixedTag,
source§impl<T> Encode for Twhere
T: EncodeValue + Tagged,
impl<T> Encode for Twhere
T: EncodeValue + Tagged,
source§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
Compute the length of this value in bytes when encoded as ASN.1 DER.
source§fn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
fn encode(&self, writer: &mut dyn Writer) -> Result<(), Error>
Encode this value as ASN.1 DER using the provided Writer
.
source§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8]>
Encode this value to the provided byte slice, returning a sub-slice
containing the encoded message.