Trait usvg_tree::ApproxEq

pub trait ApproxEq: Sized {
    type Margin: Copy + Default;

    // Required method
    fn approx_eq<M>(self, other: Self, margin: M) -> bool
       where M: Into<Self::Margin>;

    // Provided method
    fn approx_ne<M>(self, other: Self, margin: M) -> bool
       where M: Into<Self::Margin> { ... }
}
Expand description

A trait for approximate equality comparisons.

Required Associated Types§

type Margin: Copy + Default

This type type defines a margin within which two values are to be considered approximately equal. It must implement Default so that approx_eq() can be called on unknown types.

Required Methods§

fn approx_eq<M>(self, other: Self, margin: M) -> boolwhere M: Into<Self::Margin>,

This method tests that the self and other values are equal within margin of each other.

Provided Methods§

fn approx_ne<M>(self, other: Self, margin: M) -> boolwhere M: Into<Self::Margin>,

This method tests that the self and other values are not within margin of each other.

Implementations on Foreign Types§

source§

impl ApproxEq for NonZeroPositiveF32

§

type Margin = F32Margin

source§

fn approx_eq<M>(self, other: NonZeroPositiveF32, margin: M) -> boolwhere M: Into<<NonZeroPositiveF32 as ApproxEq>::Margin>,

source§

impl ApproxEq for PositiveF32

§

type Margin = F32Margin

source§

fn approx_eq<M>(self, other: PositiveF32, margin: M) -> boolwhere M: Into<<PositiveF32 as ApproxEq>::Margin>,

source§

impl ApproxEq for FiniteF64

§

type Margin = F64Margin

source§

fn approx_eq<M>(self, other: FiniteF64, margin: M) -> boolwhere M: Into<<FiniteF64 as ApproxEq>::Margin>,

source§

impl ApproxEq for FiniteF32

§

type Margin = F32Margin

source§

fn approx_eq<M>(self, other: FiniteF32, margin: M) -> boolwhere M: Into<<FiniteF32 as ApproxEq>::Margin>,

source§

impl ApproxEq for NormalizedF32

§

type Margin = F32Margin

source§

fn approx_eq<M>(self, other: NormalizedF32, margin: M) -> boolwhere M: Into<<NormalizedF32 as ApproxEq>::Margin>,

§

impl<T> ApproxEq for &[T]where T: Copy + ApproxEq,

§

type Margin = <T as ApproxEq>::Margin

§

fn approx_eq<M>(self, other: &[T], margin: M) -> boolwhere M: Into<<&[T] as ApproxEq>::Margin>,

§

impl ApproxEq for f64

§

type Margin = F64Margin

§

fn approx_eq<M>(self, other: f64, margin: M) -> boolwhere M: Into<<f64 as ApproxEq>::Margin>,

§

impl ApproxEq for f32

§

type Margin = F32Margin

§

fn approx_eq<M>(self, other: f32, margin: M) -> boolwhere M: Into<<f32 as ApproxEq>::Margin>,

Implementors§

source§

impl ApproxEq for NonZeroPositiveF64

§

type Margin = F64Margin

source§

impl ApproxEq for NormalizedF64

§

type Margin = F64Margin

source§

impl ApproxEq for PositiveF64

§

type Margin = F64Margin