Trait Unit

Source
pub trait Unit {
    // Required method
    fn unit() -> Self;
}
Expand description

A trait for types that have a unit value.

E.g. 1 for integers, 1.0 for floats, etc.

Required Methods§

Source

fn unit() -> Self

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 Unit for f32

Source§

fn unit() -> Self

Source§

impl Unit for f64

Source§

fn unit() -> Self

Source§

impl Unit for i8

Source§

fn unit() -> Self

Source§

impl Unit for i16

Source§

fn unit() -> Self

Source§

impl Unit for i32

Source§

fn unit() -> Self

Source§

impl Unit for i64

Source§

fn unit() -> Self

Source§

impl Unit for isize

Source§

fn unit() -> Self

Source§

impl Unit for u8

Source§

fn unit() -> Self

Source§

impl Unit for u16

Source§

fn unit() -> Self

Source§

impl Unit for u32

Source§

fn unit() -> Self

Source§

impl Unit for u64

Source§

fn unit() -> Self

Source§

impl Unit for usize

Source§

fn unit() -> Self

Implementors§