Skip to main content

AtLeastOne

Type Alias AtLeastOne 

Source
pub type AtLeastOne<T> = BoundedVec<T, 1, { usize::MAX }>;
Expand description

A vector type that must contain at least one element.

This is a type alias for BoundedVec<T, 1, { usize::MAX }>, provided by the bounded_vec crate. All functionality, including length constraints and safe construction, is inherited from BoundedVec.

Aliased Type§

pub struct AtLeastOne<T> { /* private fields */ }

Trait Implementations§

Source§

impl OrchardActions for AtLeastOne<AuthorizedAction>

Source§

fn actions(&self) -> impl Iterator<Item = &Action> + '_

Iterate over the Actions of each AuthorizedAction.

Source§

impl<T: ZcashDeserialize + TrustedPreallocate> ZcashDeserialize for AtLeastOne<T>

Deserialize an AtLeastOne vector, where the number of items is set by a CompactSize prefix in the data. This is the most common format in Zcash.

Source§

fn zcash_deserialize<R: Read>(reader: R) -> Result<Self, SerializationError>

Try to read self from the given reader. Read more
Source§

impl<T: ZcashSerialize> ZcashSerialize for AtLeastOne<T>

Serialize an AtLeastOne vector as a CompactSize number of items, then the items. This is the most common format in Zcash.

Source§

fn zcash_serialize<W: Write>(&self, writer: W) -> Result<(), Error>

Write self to the given writer using the canonical format. Read more
Source§

fn zcash_serialize_to_vec(&self) -> Result<Vec<u8>, Error>

Helper function to construct a vec to serialize the current struct into
Source§

fn zcash_serialized_size(&self) -> usize

Get the size of self by using a fake writer.