Struct type_level_values::const_wrapper::ConstWrapper [−][src]
pub struct ConstWrapper<Compiletime, WrapperKind>(_);
ConstWrapper type for compiletime-values.
This Type has 2 flavours:
-PhantomWrapper:Which as like a PhantomData
-AsRuntime:Which acts like the runtime version of the value.
Methods
impl<T> ConstWrapper<T, PhantomKind>
[src]
impl<T> ConstWrapper<T, PhantomKind>
pub fn to_runtime<R>(self) -> R where
T: IntoRuntime<R>,
[src]
pub fn to_runtime<R>(self) -> R where
T: IntoRuntime<R>,
impl<T, Kind> ConstWrapper<T, Kind>
[src]
impl<T, Kind> ConstWrapper<T, Kind>
pub const NEW: Self
NEW: Self = MarkerType::MTVAL
pub fn as_runtime<R>(self) -> AsRuntime<T, R>
[src]
pub fn as_runtime<R>(self) -> AsRuntime<T, R>
pub fn as_phantom(self) -> ConstWrapper<T, PhantomKind>
[src]
pub fn as_phantom(self) -> ConstWrapper<T, PhantomKind>
pub fn get(self) -> T where
T: MarkerType,
[src]
pub fn get(self) -> T where
T: MarkerType,
pub fn get_as<Runtime>(self, _: VariantPhantom<Runtime>) -> Runtime where
T: IntoRuntime<Runtime>,
[src]
pub fn get_as<Runtime>(self, _: VariantPhantom<Runtime>) -> Runtime where
T: IntoRuntime<Runtime>,
pub fn field<Field>(self, _: Field) -> GetField<T, Field> where
T: GetField_<Field>,
GetField<T, Field>: MarkerType,
[src]
pub fn field<Field>(self, _: Field) -> GetField<T, Field> where
T: GetField_<Field>,
GetField<T, Field>: MarkerType,
Returns the value of the field:
pub fn field_runt<Field, R>(self, _: Field) -> GetFieldRuntime<Self, Field, R> where
Self: GetFieldRuntime_<Field, R>,
GetField<Self, Field>: IntoRuntime<GetFieldRuntime<Self, Field, R>>,
[src]
pub fn field_runt<Field, R>(self, _: Field) -> GetFieldRuntime<Self, Field, R> where
Self: GetFieldRuntime_<Field, R>,
GetField<Self, Field>: IntoRuntime<GetFieldRuntime<Self, Field, R>>,
Returns the runtime value of the field.
pub fn field_as<Field, Runtime>(
self,
_: Field,
_: VariantPhantom<Runtime>
) -> GetFieldRuntime<T, Field, Runtime> where
T: GetFieldRuntime_<Field, Runtime>,
GetField<T, Field>: IntoRuntime<GetFieldRuntime<T, Field, Runtime>>,
[src]
pub fn field_as<Field, Runtime>(
self,
_: Field,
_: VariantPhantom<Runtime>
) -> GetFieldRuntime<T, Field, Runtime> where
T: GetFieldRuntime_<Field, Runtime>,
GetField<T, Field>: IntoRuntime<GetFieldRuntime<T, Field, Runtime>>,
Returns the runtime value of the field.
pub fn set_field<Field, Value>(self) -> SetField<Self, Field, Value> where
T: SetField_<Field, Value>,
SetField<Self, Field, Value>: WrapperTrait,
[src]
pub fn set_field<Field, Value>(self) -> SetField<Self, Field, Value> where
T: SetField_<Field, Value>,
SetField<Self, Field, Value>: WrapperTrait,
Sets the Field
field with the Value
value.
pub fn set_field_val<Field, Value>(
self,
_: Field,
_: Value
) -> SetField<Self, Field, Value> where
T: SetField_<Field, Value>,
SetField<Self, Field, Value>: WrapperTrait,
[src]
pub fn set_field_val<Field, Value>(
self,
_: Field,
_: Value
) -> SetField<Self, Field, Value> where
T: SetField_<Field, Value>,
SetField<Self, Field, Value>: WrapperTrait,
Sets the Field
field with the Value
value.
pub fn set<T2>(self) -> ConstWrapper<T2, Kind>
[src]
pub fn set<T2>(self) -> ConstWrapper<T2, Kind>
Changes the compile-time value being wrapped.
pub fn set_val<T2>(self, _: T2) -> ConstWrapper<T2, Kind>
[src]
pub fn set_val<T2>(self, _: T2) -> ConstWrapper<T2, Kind>
Changes the compile-time value being wrapped.
pub fn identity_(self, rhs: T) -> T where
T: Sized,
[src]
pub fn identity_(self, rhs: T) -> T where
T: Sized,
impl<T, Kind> ConstWrapper<T, Kind>
[src]
impl<T, Kind> ConstWrapper<T, Kind>
pub fn map_field_fn<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: FnOnce(GetField<T, Field>) -> _Value,
T: GetField_<Field>,
T: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
[src]
pub fn map_field_fn<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: FnOnce(GetField<T, Field>) -> _Value,
T: GetField_<Field>,
T: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
Maps the Field
field using the closure F
.
pub fn map_to_fn<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: FnOnce(T) -> _Value,
Self: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
[src]
pub fn map_to_fn<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: FnOnce(T) -> _Value,
Self: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
Maps the Field
field using the closure F
,which takes the entire value.
pub fn map_fn<T2, F>(self, _: F) -> ConstWrapper<T2, Kind> where
F: FnOnce(T) -> T2,
ConstWrapper<T2, Kind>: WrapperTrait,
[src]
pub fn map_fn<T2, F>(self, _: F) -> ConstWrapper<T2, Kind> where
F: FnOnce(T) -> T2,
ConstWrapper<T2, Kind>: WrapperTrait,
Maps the entire value using the closure F
.
impl<T, Kind> ConstWrapper<T, Kind>
[src]
impl<T, Kind> ConstWrapper<T, Kind>
pub fn map_field<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: CallInto<GetField<T, Field>, Returns = _Value>,
T: GetField_<Field>,
T: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
[src]
pub fn map_field<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: CallInto<GetField<T, Field>, Returns = _Value>,
T: GetField_<Field>,
T: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
Maps the Field
field using the CallInto F
.
CallInto is implemented by PhantomWrapper
pub fn map_to<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: CallInto<T, Returns = _Value>,
Self: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
[src]
pub fn map_to<Field, _Value, F>(
self,
_: Field,
_: F
) -> SetField<Self, Field, _Value> where
F: CallInto<T, Returns = _Value>,
Self: SetField_<Field, _Value>,
SetField<Self, Field, _Value>: WrapperTrait,
Maps the Field
field using the CallInto F
,which takes the entire value.
CallInto is implemented by PhantomWrapper
pub fn map<T2, F>(self, _: F) -> ConstWrapper<T2, Kind> where
F: CallInto<T, Returns = T2>,
ConstWrapper<T2, Kind>: WrapperTrait,
[src]
pub fn map<T2, F>(self, _: F) -> ConstWrapper<T2, Kind> where
F: CallInto<T, Returns = T2>,
ConstWrapper<T2, Kind>: WrapperTrait,
Maps the entire value using the CallInto F
.
CallInto is implemented by PhantomWrapper
Trait Implementations
impl<'de, T, R> Deserialize<'de> for ConstWrapper<T, RuntimeKind<R>> where
R: Deserialize<'de>,
[src]
impl<'de, T, R> Deserialize<'de> for ConstWrapper<T, RuntimeKind<R>> where
R: Deserialize<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T, R> Serialize for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Serialize,
[src]
impl<T, R> Serialize for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Serialize,
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T, Kind> WrapperTrait for ConstWrapper<T, Kind>
[src]
impl<T, Kind> WrapperTrait for ConstWrapper<T, Kind>
type ConstValue = T
type Kind = Kind
impl<T, K> GetDiscriminant for ConstWrapper<T, K>
[src]
impl<T, K> GetDiscriminant for ConstWrapper<T, K>
type Discriminant = Discriminant<ConstWrapper_Type, WrapperType, U0>
The discriminant for this CosntValue. Read more
type Variant = ConstWrapper_Type
The marker type used to have the name of the variant of this CosntValue in error messages. Read more
impl<T, K> MarkerType for ConstWrapper<T, K>
[src]
impl<T, K> MarkerType for ConstWrapper<T, K>
const MTVAL: Self
MTVAL: Self = /// The value of Self. #[allow(const_err)] const MTVAL: Self = { unsafe { __Uninit::<Self>{uninit: (),}.value } };
The value of Self.
ⓘImportant traits for &'a mut Rfn markertype_ref<'a>() -> &'a Self where
Self: 'a,
[src]
fn markertype_ref<'a>() -> &'a Self where
Self: 'a,
Constructs a reference to Self, this is possible because all references to zero sized types are valid. Read more
fn markertype_val() -> Self
[src]
fn markertype_val() -> Self
Constructs Self,this is possible because Self implements MarkerType.
impl<Compiletime, WrapperKind> Send for ConstWrapper<Compiletime, WrapperKind>
[src]
impl<Compiletime, WrapperKind> Send for ConstWrapper<Compiletime, WrapperKind>
impl<Compiletime, WrapperKind> Sync for ConstWrapper<Compiletime, WrapperKind>
[src]
impl<Compiletime, WrapperKind> Sync for ConstWrapper<Compiletime, WrapperKind>
impl<T, Kind> Default for ConstWrapper<T, Kind>
[src]
impl<T, Kind> Default for ConstWrapper<T, Kind>
impl<T, Kind> Copy for ConstWrapper<T, Kind>
[src]
impl<T, Kind> Copy for ConstWrapper<T, Kind>
impl<T, Kind> Clone for ConstWrapper<T, Kind>
[src]
impl<T, Kind> Clone for ConstWrapper<T, Kind>
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T, R> Display for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Display,
[src]
impl<T, R> Display for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Display,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Display for ConstWrapper<T, PhantomKind>
[src]
impl<T> Display for ConstWrapper<T, PhantomKind>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T, R> Debug for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Debug,
[src]
impl<T, R> Debug for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Debug,
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Debug for ConstWrapper<T, PhantomKind>
[src]
impl<T> Debug for ConstWrapper<T, PhantomKind>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T> Hash for ConstWrapper<T, PhantomKind>
[src]
impl<T> Hash for ConstWrapper<T, PhantomKind>
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T, R> Hash for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Hash,
[src]
impl<T, R> Hash for ConstWrapper<T, RuntimeKind<R>> where
T: IntoRuntime<R>,
R: Hash,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> From<T> for ConstWrapper<T, PhantomKind>
[src]
impl<T> From<T> for ConstWrapper<T, PhantomKind>
impl<T, R> From<T> for ConstWrapper<T, RuntimeKind<R>>
[src]
impl<T, R> From<T> for ConstWrapper<T, RuntimeKind<R>>
impl<T, R> From<ConstWrapper<T, RuntimeKind<R>>> for ConstWrapper<T, PhantomKind>
[src]
impl<T, R> From<ConstWrapper<T, RuntimeKind<R>>> for ConstWrapper<T, PhantomKind>
fn from(_: ConstWrapper<T, RuntimeKind<R>>) -> Self
[src]
fn from(_: ConstWrapper<T, RuntimeKind<R>>) -> Self
Performs the conversion.
impl<T, R> From<ConstWrapper<T, PhantomKind>> for ConstWrapper<T, RuntimeKind<R>>
[src]
impl<T, R> From<ConstWrapper<T, PhantomKind>> for ConstWrapper<T, RuntimeKind<R>>
fn from(_: ConstWrapper<T, PhantomKind>) -> Self
[src]
fn from(_: ConstWrapper<T, PhantomKind>) -> Self
Performs the conversion.
impl<T, K> Into<VariantPhantom<T>> for ConstWrapper<T, K>
[src]
impl<T, K> Into<VariantPhantom<T>> for ConstWrapper<T, K>
fn into(self) -> VariantPhantom<T>
[src]
fn into(self) -> VariantPhantom<T>
Performs the conversion.
impl<T, K> InitializationValues for ConstWrapper<T, K> where
T: InitializationValues,
[src]
impl<T, K> InitializationValues for ConstWrapper<T, K> where
T: InitializationValues,
type Uninitialized = ConstWrapper<T::Uninitialized, K>
Each field of this must be IsInitField< a type containing the field name >.
type Initialized = ConstWrapper<T::Initialized, K>
Each field of this must be UninitField< a type containing the field name >.
impl<T, Kind> ConstTypeOf_ for ConstWrapper<T, Kind>
[src]
impl<T, Kind> ConstTypeOf_ for ConstWrapper<T, Kind>
type Type = WrapperType
impl<T, Kind> IntoConstType_ for ConstWrapper<T, Kind>
[src]
impl<T, Kind> IntoConstType_ for ConstWrapper<T, Kind>
type ToConst = WrapperType
impl<T, Kind, Field> GetField_<Field> for ConstWrapper<T, Kind> where
T: GetField_<Field>,
[src]
impl<T, Kind, Field> GetField_<Field> for ConstWrapper<T, Kind> where
T: GetField_<Field>,
type Output = T::Output
The type of the field.
fn get_field() -> Self::Output where
Self::Output: MarkerType,
[src]
fn get_field() -> Self::Output where
Self::Output: MarkerType,
Returns the ConstValue field.
fn get_field_ref<'a>() -> &'a Self::Output where
Self::Output: MarkerType + 'a,
[src]
fn get_field_ref<'a>() -> &'a Self::Output where
Self::Output: MarkerType + 'a,
Returns the ConstValue field by reference.
fn field(self) -> Self::Output where
Self::Output: MarkerType,
[src]
fn field(self) -> Self::Output where
Self::Output: MarkerType,
Returns the ConstValue field.
fn field_ref<'a>(self) -> &'a Self::Output where
Self::Output: MarkerType + 'a,
[src]
fn field_ref<'a>(self) -> &'a Self::Output where
Self::Output: MarkerType + 'a,
Returns the ConstValue field by reference.
impl<T, Kind, Field, Value> SetField_<Field, Value> for ConstWrapper<T, Kind> where
T: SetField_<Field, Value>,
[src]
impl<T, Kind, Field, Value> SetField_<Field, Value> for ConstWrapper<T, Kind> where
T: SetField_<Field, Value>,
type Output = ConstWrapper<T::Output, Kind>
impl<T, Kind, Params> TypeFn_<Params> for ConstWrapper<T, Kind> where
T: TypeFn_<Params>,
[src]
impl<T, Kind, Params> TypeFn_<Params> for ConstWrapper<T, Kind> where
T: TypeFn_<Params>,
impl<T, Kind> Deref for ConstWrapper<T, Kind> where
T: MarkerType,
[src]
impl<T, Kind> Deref for ConstWrapper<T, Kind> where
T: MarkerType,
type Target = T
The resulting type after dereferencing.
ⓘImportant traits for &'a mut Rfn deref(&self) -> &T
[src]
fn deref(&self) -> &T
Dereferences the value.
impl<T, K> GetConstParam_ for ConstWrapper<T, K>
[src]
impl<T, K> GetConstParam_ for ConstWrapper<T, K>
type Const = T
impl<T, K> GetConstConstructor_ for ConstWrapper<T, K>
[src]
impl<T, K> GetConstConstructor_ for ConstWrapper<T, K>
type Constructor = ConstWrapperCC<K>
the ConstConstructor for this type.