pub trait OptionallyConst<T> {
const MAYBE_CONST: Option<T>;
// Required method
fn into_value(self) -> T;
}Expand description
A trait that can be used to represent a type that is either
type T or a type that represents a constant value of type T.
I.e. OptionallyConst<T> is either T or U: Const<T>.
See the Const trait for more information.
Required Associated Constants§
Sourceconst MAYBE_CONST: Option<T>
const MAYBE_CONST: Option<T>
An optional constant value of type T.
If the type does not represent a constant
(i.e. does not implement Const), this will be None.
Required Methods§
Sourcefn into_value(self) -> T
fn into_value(self) -> T
Converts the instance of the type into a value of type T.
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.