CoordinatelikeExt

Trait CoordinatelikeExt 

Source
pub trait CoordinatelikeExt<const MCL: usize, const MCC: usize, const MPL: usize, S>: Coordinatelike<MCL, MCC, MPL, S> + KeylikeExt<MCL, MCC, MPL, S> {
    // Provided methods
    fn wdm_coordinate_eq<OtherCoordinate>(
        &self,
        other: &OtherCoordinate,
    ) -> bool
       where OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>,
             S: PartialEq { ... }
    fn wdm_coordinate_ne<OtherCoordinate>(
        &self,
        other: &OtherCoordinate,
    ) -> bool
       where OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>,
             S: PartialEq { ... }
    fn wdm_is_in<G>(&self, grouping: &G) -> bool
       where G: Grouping<MCL, MCC, MPL, S> { ... }
    fn wdm_is_in_intersection<G>(&self, grouping1: &G, grouping2: &G) -> bool
       where G: Grouping<MCL, MCC, MPL, S> { ... }
}
Expand description

Methods for working with Coordinatelikes.

This trait is automatically implemented by all types implementing Coordinatelike.

Provided Methods§

Source

fn wdm_coordinate_eq<OtherCoordinate>(&self, other: &OtherCoordinate) -> bool
where OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>, S: PartialEq,

Returns whether self and other describe equal coordinates, i.e., whether their subspace ids, paths, and timestamps are all equal.

§Examples
use willow_data_model::prelude::*;

assert!(
    (Alfie, Path::<4, 4, 4>::new(), 25.into())
    .wdm_coordinate_eq(&(Alfie, Path::<4, 4, 4>::new(), 25.into()))
);
assert!(
    !(Alfie, Path::<4, 4, 4>::new(), 25.into())
    .wdm_coordinate_eq(&(Betty, Path::<4, 4, 4>::new(), 25.into()))
);
Source

fn wdm_coordinate_ne<OtherCoordinate>(&self, other: &OtherCoordinate) -> bool
where OtherCoordinate: Coordinatelike<MCL, MCC, MPL, S>, S: PartialEq,

Returns whether self and other describe non-equal coordinates, i.e., whether their subspace ids, paths, and timestamps are not all equal.

§Examples
use willow_data_model::prelude::*;

assert!(
    !(Alfie, Path::<4, 4, 4>::new(), 25.into())
    .wdm_coordinate_ne(&(Alfie, Path::<4, 4, 4>::new(), 25.into()))
);
assert!(
    (Alfie, Path::<4, 4, 4>::new(), 25.into())
    .wdm_coordinate_ne(&(Betty, Path::<4, 4, 4>::new(), 25.into()))
);
Source

fn wdm_is_in<G>(&self, grouping: &G) -> bool
where G: Grouping<MCL, MCC, MPL, S>,

Returns whether self is included in the given Grouping.

use willow_data_model::prelude::*;

assert!(
    (Alfie, Path::<4, 4, 4>::new(), 8.into())
    .wdm_is_in(
        &Range3d::<4, 4, 4, TestSubspace>::new(
            SubspaceRange::new_open(Alfie),
            PathRange::full(),
            TimeRange::new_closed(0.into(), 17.into()),
        )
    )
);
assert!(
    !(Alfie, Path::<4, 4, 4>::new(), 52.into())
    .wdm_is_in(
        &Range3d::<4, 4, 4, TestSubspace>::new(
            SubspaceRange::new_open(Alfie),
            PathRange::full(),
            TimeRange::new_closed(0.into(), 17.into()),
        )
    )
);
Source

fn wdm_is_in_intersection<G>(&self, grouping1: &G, grouping2: &G) -> bool
where G: Grouping<MCL, MCC, MPL, S>,

Returns whether self is included in the intersection of the two given Groupings.

use willow_data_model::prelude::*;

assert!(
    (Alfie, Path::<4, 4, 4>::new(), 25.into())
    .wdm_is_in_intersection(
        &Range3d::<4, 4, 4, TestSubspace>::new(
            SubspaceRange::new_open(Alfie),
            PathRange::full(),
            TimeRange::new_open(17.into()),
        ),
        &Range3d::<4, 4, 4, TestSubspace>::new(
            SubspaceRange::new_open(Alfie),
            PathRange::full(),
            TimeRange::new_closed(0.into(), 28.into()),
        ),
    )
);

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§

Source§

impl<const MCL: usize, const MCC: usize, const MPL: usize, S, T> CoordinatelikeExt<MCL, MCC, MPL, S> for T
where T: Coordinatelike<MCL, MCC, MPL, S>,