typst_utils

Trait Numeric

source
pub trait Numeric:
    Sized
    + Debug
    + Copy
    + PartialEq
    + Neg<Output = Self>
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<f64, Output = Self>
    + Div<f64, Output = Self> {
    // Required methods
    fn zero() -> Self;
    fn is_finite(self) -> bool;

    // Provided method
    fn is_zero(self) -> bool { ... }
}
Expand description

A numeric type.

Required Methods§

source

fn zero() -> Self

The identity element for addition.

source

fn is_finite(self) -> bool

Whether self consists only of finite parts.

Provided Methods§

source

fn is_zero(self) -> bool

Whether self is zero.

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§