Trait MapCoordsInplace

Source
pub trait MapCoordsInplace<T>: MapCoordsInPlace<T> {
    // Required method
    fn map_coords_inplace(&mut self, func: impl Fn((T, T)) -> (T, T) + Copy)
       where T: CoordNum;
}
👎Deprecated since 0.21.0: use MapCoordsInPlace::map_coords_in_place instead which takes a Coord instead of an (x,y) tuple
Expand description

Map a function over all the coordinates in an object in place

Required Methods§

Source

fn map_coords_inplace(&mut self, func: impl Fn((T, T)) -> (T, T) + Copy)
where T: CoordNum,

👎Deprecated since 0.21.0: use MapCoordsInPlace::map_coords_in_place instead which takes a Coord instead of an (x,y) tuple

Apply a function to all the coordinates in a geometric object, in place

§Examples
#[allow(deprecated)]
use geo::MapCoordsInplace;
use geo::Point;
use approx::assert_relative_eq;

let mut p = Point::new(10., 20.);
#[allow(deprecated)]
p.map_coords_inplace(|(x, y)| (x + 1000., y * 2.));

assert_relative_eq!(p, Point::new(1010., 40.), epsilon = 1e-6);

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§