[go: up one dir, main page]

ConstChain

Trait ConstChain 

Source
pub trait ConstChain<const N: usize>: Chain {
    // Provided method
    fn to_array(&self) -> [Self::Output; N]
       where Self::Output: Copy + Default { ... }
}
Expand description

Trait for Chain where its length is known at compile-time.

Provided Methods§

Source

fn to_array(&self) -> [Self::Output; N]
where Self::Output: Copy + Default,

Collect all elements generated into an array.

This function may be useful if one wants to save intermediate steps instead of generating and calculating it.

If you want to transform a ConstChain to a collection, you may use .iter().collect() instead.

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: ConstChain<N> + ?Sized, const N: usize> ConstChain<N> for &G

Source§

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

Implementors§

Source§

impl<G> ConstChain<{ usize::MAX }> for Repeat<G>
where G: Chain,

Source§

impl<G, H, const N: usize> ConstChain<N> for Stack<G, H>
where G: ConstChain<N>, H: ConstChain<N>,

Source§

impl<G, const N: usize> ConstChain<N> for Weights<G>
where G: ConstChain<N>, G::Output: IntoWeight,