LinearType

Trait LinearType 

Source
pub trait LinearType: PrimitiveType {
    // Required method
    fn is_linear(&self) -> bool;
}
Expand description

Primitive type which supports a notion of linearity. Linear types are types that can be used in arithmetic ops.

Required Methods§

Source

fn is_linear(&self) -> bool

Returns true iff this type is linear.

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 LinearType for Num

Numbers are linear, Boolean values are not.