pub trait CoordTranslate {
    type From;

    // Required method
    fn translate(&self, from: &Self::From) -> (i32, i32);

    // Provided method
    fn depth(&self, _from: &Self::From) -> i32 { ... }
}
Expand description

The trait that translates some customized object to the backend coordinate

Required Associated Types§

source

type From

Specifies the object to be translated from

Required Methods§

source

fn translate(&self, from: &Self::From) -> (i32, i32)

Translate the guest coordinate to the guest coordinate

Provided Methods§

source

fn depth(&self, _from: &Self::From) -> i32

Get the Z-value of current coordinate

Implementors§

source§

impl CoordTranslate for Shift

§

type From = (i32, i32)

source§

impl<C, T> CoordTranslate for T
where C: CoordTranslate, T: Deref<Target = C>,

§

type From = <C as CoordTranslate>::From

source§

impl<X, Y> CoordTranslate for Cartesian2d<X, Y>
where X: Ranged, Y: Ranged,

§

type From = (<X as Ranged>::ValueType, <Y as Ranged>::ValueType)

source§

impl<X, Y, Z> CoordTranslate for Cartesian3d<X, Y, Z>
where X: Ranged, Y: Ranged, Z: Ranged,

§

type From = (<X as Ranged>::ValueType, <Y as Ranged>::ValueType, <Z as Ranged>::ValueType)