Skip to main content

OneOrMany

Trait OneOrMany 

Source
pub trait OneOrMany<T> {
    type Iter: Iterator<Item = T>;

    // Required method
    fn into_iter(self) -> Self::Iter;
}
Expand description

A trait that represents one or many values of given type.

Useful to accept as parameter type to let the caller pass either a single value directly or an iterator.

Required Associated Types§

Source

type Iter: Iterator<Item = T>

The iterator type.

Required Methods§

Source

fn into_iter(self) -> Self::Iter

Convert this item into an iterator.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'a> OneOrMany<DispatchClass> for &'a [DispatchClass]

Implementors§