Trait X2Interface

Source
pub trait X2Interface {
    type Scalar: ScalarInterface;

    // Required methods
    fn _0(&self) -> Self::Scalar;
    fn _1(&self) -> Self::Scalar;

    // Provided methods
    fn x(&self) -> Self::Scalar { ... }
    fn y(&self) -> Self::Scalar { ... }
    fn clone_as_tuple(&self) -> (Self::Scalar, Self::Scalar) { ... }
    fn clone_as_array(&self) -> [Self::Scalar; 2] { ... }
    fn clone_as_canonical(&self) -> X2<Self::Scalar> { ... }
}
Expand description

Nominal interface of vector X2.

Required Associated Types§

Source

type Scalar: ScalarInterface

Type of element.

Required Methods§

Source

fn _0(&self) -> Self::Scalar

First element.

Source

fn _1(&self) -> Self::Scalar

Second element.

Provided Methods§

Source

fn x(&self) -> Self::Scalar

First element.

Source

fn y(&self) -> Self::Scalar

Second element.

Source

fn clone_as_tuple(&self) -> (Self::Scalar, Self::Scalar)

Clone as tuple.

Source

fn clone_as_array(&self) -> [Self::Scalar; 2]

Clone as array.

Source

fn clone_as_canonical(&self) -> X2<Self::Scalar>

Clone as canonical.

Implementations on Foreign Types§

Source§

impl<Scalar> X2NominalInterface for &[Scalar]
where Scalar: ScalarInterface,

Source§

impl<Scalar> X2NominalInterface for [Scalar; 2]
where Scalar: ScalarInterface,

Source§

impl<Scalar> X2NominalInterface for (Scalar, Scalar)
where Scalar: ScalarInterface,

Implementors§

Source§

impl<Scalar> X2NominalInterface for X2<Scalar>
where Scalar: ScalarInterface,

Source§

type Scalar = Scalar