Skip to main content

NumSet

Trait NumSet 

Source
pub trait NumSet: Clone + Debug {
    type Int: TeXInt;
    type Dim: TeXDimen + Numeric<Self::Int>;
    type MuDim: MuDim + Numeric<Self::Int>;

    // Required methods
    fn mudim_to_dim(mudim: Self::MuDim, em: Self::Dim) -> Self::Dim;
    fn dim_to_int(dim: Self::Dim) -> Self::Int;

    // Provided method
    fn muskip_to_skip(
        muskip: MuSkip<Self::MuDim>,
        em: Self::Dim,
    ) -> Skip<Self::Dim> { ... }
}
Expand description

Bundles the various numerical types used in some engine, and converts between them.

Required Associated Types§

Source

type Int: TeXInt

The integer type (canonically i32)

Source

type Dim: TeXDimen + Numeric<Self::Int>

The dimension type (canonically Dim32)

Source

type MuDim: MuDim + Numeric<Self::Int>

The mu dimension type (canonically Mu)

Required Methods§

Source

fn mudim_to_dim(mudim: Self::MuDim, em: Self::Dim) -> Self::Dim

Converts a Self::MuDim to a Self::Dim, using the current font’s em.

Source

fn dim_to_int(dim: Self::Dim) -> Self::Int

Converts a Self::Dim to a Self::Int.

Provided Methods§

Source

fn muskip_to_skip(muskip: MuSkip<Self::MuDim>, em: Self::Dim) -> Skip<Self::Dim>

Converts a MuSkip to a Skip, using the current font’s em.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§