Skip to main content

ObjFloat

Trait ObjFloat 

Source
pub trait ObjFloat:
    Copy
    + Display
    + FromStr
    + PartialEq {
    // Required methods
    fn fract(self) -> Self;
    fn zero() -> Self;

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

Trait for floating point types that can be used in OBJ files. This allows the library to work with both f32 and f64 precision.

Required Methods§

Source

fn fract(self) -> Self

Returns the fractional part of the number

Source

fn zero() -> Self

Returns the zero value for this type

Provided Methods§

Source

fn is_zero_fract(self) -> bool

Returns true if the fractional part 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.

Implementations on Foreign Types§

Source§

impl ObjFloat for f32

Source§

fn fract(self) -> Self

Source§

fn zero() -> Self

Source§

impl ObjFloat for f64

Source§

fn fract(self) -> Self

Source§

fn zero() -> Self

Implementors§