pub trait IsEditable2D: Is2D + IsEditableND {
// Required methods
fn set_x(&mut self, val: f64);
fn set_y(&mut self, val: f64);
// Provided methods
fn set_xy(&mut self, x: f64, y: f64) { ... }
fn increase_distance_to_by<P>(&mut self, other: &P, factor: Positive)
where P: Is2D { ... }
fn add<P>(&mut self, other: &P)
where P: Is2D { ... }
fn subtract<P>(&mut self, other: &P)
where P: Is2D { ... }
fn scale_pos(&mut self, val: f64) { ... }
fn rotate<P>(&mut self, r: Rad, center: &P)
where P: Is2D { ... }
}
Expand description
IsEditable2D is a trait used for types which are positioned in 2D space and their position can be changed
Required Methods§
Provided Methods§
Sourcefn increase_distance_to_by<P>(&mut self, other: &P, factor: Positive)where
P: Is2D,
fn increase_distance_to_by<P>(&mut self, other: &P, factor: Positive)where
P: Is2D,
Increases distance towards other by factor
Sourcefn add<P>(&mut self, other: &P)where
P: Is2D,
fn add<P>(&mut self, other: &P)where
P: Is2D,
Adds the coordinates of other onto this. x = x + other.x …
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.