pub trait Position<T, const N: usize>{
Show 35 methods
// Required methods
fn pos(&self) -> Vector<T, N>;
fn set_pos(&mut self, pos: Vector<T, N>) -> &mut Self;
// Provided methods
fn x(&self) -> T
where Vector<T, N>: HaveX<T> { ... }
fn y(&self) -> T
where Vector<T, N>: HaveY<T> { ... }
fn z(&self) -> T
where Vector<T, N>: HaveZ<T> { ... }
fn w(&self) -> T
where Vector<T, N>: HaveW<T> { ... }
fn set_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> { ... }
fn set_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> { ... }
fn set_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> { ... }
fn set_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> { ... }
fn with_pos(self, pos: Vector<T, N>) -> Self
where Self: Sized { ... }
fn with_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T>,
Self: Sized { ... }
fn with_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T>,
Self: Sized { ... }
fn with_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T>,
Self: Sized { ... }
fn with_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T>,
Self: Sized { ... }
fn move_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
where Vector<T, N>: Add<Vector<T, N>, Output = Vector<T, N>> { ... }
fn move_neg_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
where Vector<T, N>: Sub<Vector<T, N>, Output = Vector<T, N>> { ... }
fn move_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>> { ... }
fn move_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>> { ... }
fn move_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>> { ... }
fn move_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>> { ... }
fn move_neg_x(&mut self, x: T) -> &mut Self
where Vector<T, N>: HaveX<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T> { ... }
fn move_neg_y(&mut self, y: T) -> &mut Self
where Vector<T, N>: HaveY<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T> { ... }
fn move_neg_z(&mut self, z: T) -> &mut Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T> { ... }
fn move_neg_w(&mut self, w: T) -> &mut Self
where Vector<T, N>: HaveW<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T> { ... }
fn moved_by(self, v: impl Into<Vector<T, N>>) -> Self
where Vector<T, N>: Add<Vector<T, N>, Output = Vector<T, N>>,
Self: Sized { ... }
fn moved_neg_by(self, v: impl Into<Vector<T, N>>) -> Self
where Vector<T, N>: Sub<Vector<T, N>, Output = Vector<T, N>>,
Self: Sized { ... }
fn moved_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
Self: Sized { ... }
fn moved_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
Self: Sized { ... }
fn moved_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
Self: Sized { ... }
fn moved_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
Self: Sized { ... }
fn moved_neg_x(self, x: T) -> Self
where Vector<T, N>: HaveX<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T>,
Self: Sized { ... }
fn moved_neg_y(self, y: T) -> Self
where Vector<T, N>: HaveY<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T>,
Self: Sized { ... }
fn moved_neg_z(self, z: T) -> Self
where Vector<T, N>: HaveZ<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T>,
Self: Sized { ... }
fn moved_neg_w(self, w: T) -> Self
where Vector<T, N>: HaveW<T> + Zero + Add<Vector<T, N>, Output = Vector<T, N>>,
T: Neg<Output = T>,
Self: Sized { ... }
}Required Methods§
Provided Methods§
fn x(&self) -> T
fn y(&self) -> T
fn z(&self) -> T
fn w(&self) -> T
fn set_x(&mut self, x: T) -> &mut Self
fn set_y(&mut self, y: T) -> &mut Self
fn set_z(&mut self, z: T) -> &mut Self
fn set_w(&mut self, w: T) -> &mut Self
fn with_pos(self, pos: Vector<T, N>) -> Selfwhere
Self: Sized,
fn with_x(self, x: T) -> Self
fn with_y(self, y: T) -> Self
fn with_z(self, z: T) -> Self
fn with_w(self, w: T) -> Self
fn move_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
fn move_neg_by(&mut self, v: impl Into<Vector<T, N>>) -> &mut Self
fn move_x(&mut self, x: T) -> &mut Self
fn move_y(&mut self, y: T) -> &mut Self
fn move_z(&mut self, z: T) -> &mut Self
fn move_w(&mut self, w: T) -> &mut Self
fn move_neg_x(&mut self, x: T) -> &mut Self
fn move_neg_y(&mut self, y: T) -> &mut Self
fn move_neg_z(&mut self, z: T) -> &mut Self
fn move_neg_w(&mut self, w: T) -> &mut Self
fn moved_by(self, v: impl Into<Vector<T, N>>) -> Self
fn moved_neg_by(self, v: impl Into<Vector<T, N>>) -> Self
fn moved_x(self, x: T) -> Self
fn moved_y(self, y: T) -> Self
fn moved_z(self, z: T) -> Self
fn moved_w(self, w: T) -> Self
fn moved_neg_x(self, x: T) -> Self
fn moved_neg_y(self, y: T) -> Self
fn moved_neg_z(self, z: T) -> Self
fn moved_neg_w(self, w: T) -> Self
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.