skia_safe

Trait Scalar

Source
pub trait Scalar: Copy {
    const ZERO: Self;
    const NEARLY_ZERO: Self;
    const ONE: Self;
    const HALF: Self;

    // Required methods
    fn nearly_equal(
        x: scalar,
        y: scalar,
        tolerance: impl Into<Option<scalar>>,
    ) -> bool;
    fn nearly_zero(&self, tolerance: impl Into<Option<scalar>>) -> bool;
}

Required Associated Constants§

Source

const ZERO: Self

Source

const NEARLY_ZERO: Self

Source

const ONE: Self

Source

const HALF: Self

Required Methods§

Source

fn nearly_equal( x: scalar, y: scalar, tolerance: impl Into<Option<scalar>>, ) -> bool

Source

fn nearly_zero(&self, tolerance: impl Into<Option<scalar>>) -> bool

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 Scalar for scalar

Source§

const ZERO: Self = 0f32

Source§

const NEARLY_ZERO: Self = 2.44140625E-4f32

Source§

const ONE: Self = 1f32

Source§

const HALF: Self = 0.5f32