pub struct Multiport<T: Sync> { /* private fields */ }Expand description
A multiport is a vector of independent ports (its channels) Multiports have special Lingua Franca syntax, similar to reactor banks.
Implementations§
Source§impl<T: Sync> Multiport<T>
impl<T: Sync> Multiport<T>
Sourcepub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Port<T>>
pub fn iter_mut(&mut self) -> impl Iterator<Item = &mut Port<T>>
Iterate over the multiport and return mutable references to individual channels.
Sourcepub fn iter(&self) -> impl Iterator<Item = &Port<T>>
pub fn iter(&self) -> impl Iterator<Item = &Port<T>>
Iterate over the channels of this multiport. Returns read-only references to individual ports.
Sourcepub fn enumerate_set(&self) -> impl Iterator<Item = (usize, &Port<T>)>
pub fn enumerate_set(&self) -> impl Iterator<Item = (usize, &Port<T>)>
Iterate over only those channels that are set (have a value). Returns a tuple with their index (not necessarily contiguous).
Sourcepub fn iterate_set(&self) -> impl Iterator<Item = &Port<T>>
pub fn iterate_set(&self) -> impl Iterator<Item = &Port<T>>
Iterate over only those channels that are set (have a value). The returned ports are not necessarily contiguous. See Self::enumerate_set to get access to their index.
Sourcepub fn iterate_values(&self) -> impl Iterator<Item = T> + '_where
T: Copy,
pub fn iterate_values(&self) -> impl Iterator<Item = T> + '_where
T: Copy,
Iterate over only those channels that are set (have a value), and return a copy of the value. The returned ports are not necessarily contiguous. See Self::enumerate_values to get access to their index.
Sourcepub fn iterate_values_ref(&self) -> impl Iterator<Item = &T> + '_
pub fn iterate_values_ref(&self) -> impl Iterator<Item = &T> + '_
Iterate over only those ports that are set (have a value), and return a reference to the value. The returned ports are not necessarily contiguous. See Self::enumerate_values to get access to their index.
Sourcepub fn enumerate_values(&self) -> impl Iterator<Item = (usize, T)> + '_where
T: Copy,
pub fn enumerate_values(&self) -> impl Iterator<Item = (usize, T)> + '_where
T: Copy,
Iterate over only those channels that are set (have a value), yielding a tuple with their index in the bank and a copy of the value.
Sourcepub fn enumerate_values_ref(&self) -> impl Iterator<Item = (usize, &T)> + '_
pub fn enumerate_values_ref(&self) -> impl Iterator<Item = (usize, &T)> + '_
Iterate over only those channels that are set (have a value), yielding a tuple with their index in the bank and a reference to the value.