pub enum CompileTimeConstant<T: PartialEq> {
Literal(T),
Identifier(String),
Substituted(T, String),
}Expand description
A compile time constant, i.e. a literal, some pre-defined constant (or an expression of such, TODO)
Variants§
Literal(T)
A literal (i.e. some concrete value)
Identifier(String)
An identifier (i.e. some not yet substituted value)
Substituted(T, String)
An identifier after substitution (the old name is saved for debugging)
Implementations§
Source§impl<T: PartialEq> CompileTimeConstant<T>
impl<T: PartialEq> CompileTimeConstant<T>
Sourcepub fn substitute(&mut self, value: T)
pub fn substitute(&mut self, value: T)
In-place-ish substitution (does nothing, if substitution not possible)
Trait Implementations§
Source§impl<T: Clone + PartialEq> Clone for CompileTimeConstant<T>
impl<T: Clone + PartialEq> Clone for CompileTimeConstant<T>
Source§fn clone(&self) -> CompileTimeConstant<T>
fn clone(&self) -> CompileTimeConstant<T>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConstantSubstitution for CompileTimeConstant<f64>
impl ConstantSubstitution for CompileTimeConstant<f64>
fn substitute_constant( &mut self, name: &str, value: &SubstitutionValue, ) -> Result<()>
Source§impl ConstantSubstitution for CompileTimeConstant<i64>
impl ConstantSubstitution for CompileTimeConstant<i64>
fn substitute_constant( &mut self, name: &str, value: &SubstitutionValue, ) -> Result<()>
Source§impl ConstantSubstitution for CompileTimeConstant<usize>
impl ConstantSubstitution for CompileTimeConstant<usize>
fn substitute_constant( &mut self, name: &str, value: &SubstitutionValue, ) -> Result<()>
Source§impl<T: PartialEq> From<T> for CompileTimeConstant<T>
impl<T: PartialEq> From<T> for CompileTimeConstant<T>
impl<T: Eq + PartialEq> Eq for CompileTimeConstant<T>
impl<T: PartialEq> StructuralPartialEq for CompileTimeConstant<T>
Auto Trait Implementations§
impl<T> Freeze for CompileTimeConstant<T>where
T: Freeze,
impl<T> RefUnwindSafe for CompileTimeConstant<T>where
T: RefUnwindSafe,
impl<T> Send for CompileTimeConstant<T>where
T: Send,
impl<T> Sync for CompileTimeConstant<T>where
T: Sync,
impl<T> Unpin for CompileTimeConstant<T>where
T: Unpin,
impl<T> UnwindSafe for CompileTimeConstant<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more