Trait Cartesian

Source
pub trait Cartesian {
    // Required methods
    fn x(&self) -> f64;
    fn y(&self) -> f64;

    // Provided methods
    fn distance<T: Cartesian + ?Sized>(&self, other: &T) -> f64 { ... }
    fn delta<T: Address + Clone + Cartesian + Sync + Send>(
        &self,
        others: &[T],
        min: f64,
    ) -> AddressDeltas
       where Self: Address + Cartesian + Sized + Clone + Send + Sync { ... }
    fn deltas<T: Cartesian + Address + Clone + Sync + Send, U: Cartesian + Address + Clone + Sync + Send>(
        values: &[T],
        other: &[U],
        min: f64,
    ) -> AddressDeltas { ... }
}
Expand description

The type can produce cartesian coordinates.

Required Methods§

Source

fn x(&self) -> f64

The x method returns the cartesian X portion of the projected coordinates of the address.

Source

fn y(&self) -> f64

The y method returns the cartesian Y portion of the projected coordinates of the address.

Provided Methods§

Source

fn distance<T: Cartesian + ?Sized>(&self, other: &T) -> f64

The distance function returns the distance between a point self and another point other in the same unit as self.

Source

fn delta<T: Address + Clone + Cartesian + Sync + Send>( &self, others: &[T], min: f64, ) -> AddressDeltas
where Self: Address + Cartesian + Sized + Clone + Send + Sync,

Distance between address and other addresses with matching label. Iterates through records of others, calculates the distance from self to matching addresses in others, collects the results into a vector and returns the results in the records field of a new AddressDeltas struct.

Source

fn deltas<T: Cartesian + Address + Clone + Sync + Send, U: Cartesian + Address + Clone + Sync + Send>( values: &[T], other: &[U], min: f64, ) -> AddressDeltas

Distance between addresses and other addresses with matching label. Iterates through records of others, calculates the distance from self to matching addresses in others, collects the results into a vector and returns the results in the records field of a new AddressDeltas struct. Calls [Point::delta].

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§