Skip to main content

Axis

Trait Axis 

Source
pub trait Axis:
    Copy
    + Debug
    + Default
    + Hash
    + Ord
    + Send
    + Sync {
    type Dim<S: Shape>: Dim;
    type Init<S: Shape>: Shape;
    type Rest<S: Shape>: Shape;
    type Remove<S: Shape>: Shape;
    type Resize<D: Dim, S: Shape>: Shape;

    // Required method
    fn index(self, rank: usize) -> usize;
}
Expand description

Array axis trait, for subarray shapes.

Required Associated Types§

Source

type Dim<S: Shape>: Dim

Corresponding dimension.

Source

type Init<S: Shape>: Shape

Shape for the previous dimensions excluding the current dimension.

Source

type Rest<S: Shape>: Shape

Shape for the next dimensions excluding the current dimension.

Source

type Remove<S: Shape>: Shape

Remove the dimension from the shape.

Source

type Resize<D: Dim, S: Shape>: Shape

Resize the dimension in the shape.

Required Methods§

Source

fn index(self, rank: usize) -> usize

Returns the dimension index.

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.

Implementors§

Source§

impl Axis for Const<0>

Source§

type Dim<S: Shape> = <S as Shape>::Head

Source§

type Init<S: Shape> = ()

Source§

type Rest<S: Shape> = <S as Shape>::Tail

Source§

type Remove<S: Shape> = <S as Shape>::Tail

Source§

type Resize<D: Dim, S: Shape> = <<S as Shape>::Tail as Shape>::Prepend<D>

Source§

impl Axis for Const<1>

Source§

type Dim<S: Shape> = <Const<0> as Axis>::Dim<<S as Shape>::Tail>

Source§

type Init<S: Shape> = <<Const<0> as Axis>::Init<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Rest<S: Shape> = <Const<0> as Axis>::Rest<<S as Shape>::Tail>

Source§

type Remove<S: Shape> = <<Const<0> as Axis>::Remove<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Resize<D: Dim, S: Shape> = <<Const<0> as Axis>::Resize<D, <S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

impl Axis for Const<2>

Source§

type Dim<S: Shape> = <Const<1> as Axis>::Dim<<S as Shape>::Tail>

Source§

type Init<S: Shape> = <<Const<1> as Axis>::Init<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Rest<S: Shape> = <Const<1> as Axis>::Rest<<S as Shape>::Tail>

Source§

type Remove<S: Shape> = <<Const<1> as Axis>::Remove<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Resize<D: Dim, S: Shape> = <<Const<1> as Axis>::Resize<D, <S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

impl Axis for Const<3>

Source§

type Dim<S: Shape> = <Const<2> as Axis>::Dim<<S as Shape>::Tail>

Source§

type Init<S: Shape> = <<Const<2> as Axis>::Init<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Rest<S: Shape> = <Const<2> as Axis>::Rest<<S as Shape>::Tail>

Source§

type Remove<S: Shape> = <<Const<2> as Axis>::Remove<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Resize<D: Dim, S: Shape> = <<Const<2> as Axis>::Resize<D, <S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

impl Axis for Const<4>

Source§

type Dim<S: Shape> = <Const<3> as Axis>::Dim<<S as Shape>::Tail>

Source§

type Init<S: Shape> = <<Const<3> as Axis>::Init<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Rest<S: Shape> = <Const<3> as Axis>::Rest<<S as Shape>::Tail>

Source§

type Remove<S: Shape> = <<Const<3> as Axis>::Remove<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Resize<D: Dim, S: Shape> = <<Const<3> as Axis>::Resize<D, <S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

impl Axis for Const<5>

Source§

type Dim<S: Shape> = <Const<4> as Axis>::Dim<<S as Shape>::Tail>

Source§

type Init<S: Shape> = <<Const<4> as Axis>::Init<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Rest<S: Shape> = <Const<4> as Axis>::Rest<<S as Shape>::Tail>

Source§

type Remove<S: Shape> = <<Const<4> as Axis>::Remove<<S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

type Resize<D: Dim, S: Shape> = <<Const<4> as Axis>::Resize<D, <S as Shape>::Tail> as Shape>::Prepend<<S as Shape>::Head>

Source§

impl Axis for Cols

Source§

type Dim<S: Shape> = <Const<1> as Axis>::Dim<<S as Shape>::Reverse>

Source§

type Init<S: Shape> = <<Const<1> as Axis>::Rest<<S as Shape>::Reverse> as Shape>::Reverse

Source§

type Rest<S: Shape> = <<Const<1> as Axis>::Init<<S as Shape>::Reverse> as Shape>::Reverse

Source§

type Remove<S: Shape> = <<Const<1> as Axis>::Remove<<S as Shape>::Reverse> as Shape>::Reverse

Source§

type Resize<D: Dim, S: Shape> = <<Const<1> as Axis>::Resize<D, <S as Shape>::Reverse> as Shape>::Reverse

Source§

impl Axis for Rows

Source§

type Dim<S: Shape> = <Const<0> as Axis>::Dim<<S as Shape>::Reverse>

Source§

type Init<S: Shape> = <<Const<0> as Axis>::Rest<<S as Shape>::Reverse> as Shape>::Reverse

Source§

type Rest<S: Shape> = <<Const<0> as Axis>::Init<<S as Shape>::Reverse> as Shape>::Reverse

Source§

type Remove<S: Shape> = <<Const<0> as Axis>::Remove<<S as Shape>::Reverse> as Shape>::Reverse

Source§

type Resize<D: Dim, S: Shape> = <<Const<0> as Axis>::Resize<D, <S as Shape>::Reverse> as Shape>::Reverse

Source§

impl Axis for Dyn

Source§

type Dim<S: Shape> = usize

Source§

type Init<S: Shape> = DynRank

Source§

type Rest<S: Shape> = DynRank

Source§

type Remove<S: Shape> = <<S as Shape>::Tail as Shape>::Dyn

Source§

type Resize<D: Dim, S: Shape> = <S as Shape>::Dyn