[go: up one dir, main page]

Chain

Trait Chain 

Source
pub trait Chain: Signal<usize> {
    // Required method
    fn len(&self) -> usize;

    // Provided methods
    fn first(&self) -> Option<Self::Output> { ... }
    fn last(&self) -> Option<Self::Output> { ... }
    fn is_empty(&self) -> bool { ... }
    fn into_iter(self) -> IntoIter<Self>
       where Self: Sized { ... }
    fn iter(&self) -> IntoIter<&Self> { ... }
    fn repeat(self) -> Repeat<Self>
       where Self: Sized { ... }
}
Expand description

Specialized Signal with input of type usize.

All Chain must return valid values when using inputs less than the value returned by their len() method.

Required Methods§

Source

fn len(&self) -> usize

Returns the minimum amount of elements the signal can create.

The signal has to guarantee that every usize number lower than the returned number has to create a valid element.

Provided Methods§

Source

fn first(&self) -> Option<Self::Output>

Returns the first element of the signal, or None if it is empty.

Source

fn last(&self) -> Option<Self::Output>

Returns the last element of the signal, or None if it is empty.

Source

fn is_empty(&self) -> bool

Returns true if the signal does not generate any elements.

Source

fn into_iter(self) -> IntoIter<Self>
where Self: Sized,

Convert signal to an iterator which steps through all generatable values.

Source

fn iter(&self) -> IntoIter<&Self>

Create iterator which steps through all generatable values.

Source

fn repeat(self) -> Repeat<Self>
where Self: Sized,

Transform signal to one which repeats its elements.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<G: Chain + ?Sized> Chain for &G

Source§

fn len(&self) -> usize

Source§

impl<T: Copy> Chain for &[T]

Source§

fn len(&self) -> usize

Source§

impl<T: Copy> Chain for Vec<T>

Available on crate feature std only.
Source§

fn len(&self) -> usize

Source§

impl<T: Copy, const N: usize> Chain for [T; N]

Source§

fn len(&self) -> usize

Implementors§

Source§

impl<C> Chain for Sorted<C>
where C: Chain,

Source§

impl<G> Chain for BorderBuffer<G>
where G: Chain,

Source§

impl<G> Chain for BorderDeletion<G>
where G: Chain,

Source§

impl<G> Chain for Repeat<G>
where G: Chain,

Source§

impl<G> Chain for Wrap<G>
where G: Chain,

Source§

impl<G> Chain for Weights<G>
where G: Chain, G::Output: IntoWeight,

Source§

impl<G, H> Chain for Stack<G, H>
where G: Chain, H: Chain,

Source§

impl<R> Chain for Equidistant<R>
where R: Real + FromPrimitive,

Source§

impl<R, const N: usize> Chain for ConstEquidistant<R, N>
where R: Real + FromPrimitive,