[][src]Trait modtype::ConstValue

pub trait ConstValue: Copy + Ord + Debug {
    type Value: Copy;

    const VALUE: Self::Value;
}

A trait that has one associated constant value.

This trait requires Copy+Ord+Debug because of #26925. To implement this trait, use use_modtype rather than the derive macro.

Example

use modtype::ConstValue;

#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, ConstValue)]
#[modtype(const_value = 17u32)]
enum Const17U32 {}

assert_eq!(Const17U32::VALUE, 17u32);

Associated Types

type Value: Copy

Loading content...

Associated Constants

const VALUE: Self::Value

Loading content...

Implementors

Loading content...