pub enum SubstitutionFunction {
Var(VarFunction),
Env(EnvFunction),
Attr(AttrFunction),
}Expand description
A substitution function along with the data specific to it.
Variants§
Var(VarFunction)
A var() reference.
Env(EnvFunction)
An env() reference.
Attr(AttrFunction)
An attr() reference.
Implementations§
Source§impl SubstitutionFunction
impl SubstitutionFunction
Sourcepub fn parse(
kind: SubstitutionFunctionKind,
input: &mut Parser<'_>,
context: &mut SubstitutionParserContext<'_>,
) -> Result<Self, ParseError>
pub fn parse( kind: SubstitutionFunctionKind, input: &mut Parser<'_>, context: &mut SubstitutionParserContext<'_>, ) -> Result<Self, ParseError>
Parses the arguments of a substitution function of the given kind, with input
positioned inside its nested block.
Sourcepub fn reference_flags(&self) -> ReferenceFlags
pub fn reference_flags(&self) -> ReferenceFlags
The reference flags to record for a reference to this function.
fn replace<'a>( &'a self, source: &'a VariableValue, context: &mut SubstitutionReplacementContext<'a, '_, '_, '_>, ) -> Result<Substitution<'a>, ()>
Sourcepub fn for_each_unparsed_value<F>(&self, f: F)where
F: FnMut(&ArbitraryDeclarationValue),
pub fn for_each_unparsed_value<F>(&self, f: F)where
F: FnMut(&ArbitraryDeclarationValue),
Calls f for each arbitrary declaration value nested in the function.
Trait Implementations§
Source§impl Clone for SubstitutionFunction
impl Clone for SubstitutionFunction
Source§fn clone(&self) -> SubstitutionFunction
fn clone(&self) -> SubstitutionFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SubstitutionFunction
impl Debug for SubstitutionFunction
Source§impl MallocSizeOf for SubstitutionFunction
impl MallocSizeOf for SubstitutionFunction
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Source§impl PartialEq for SubstitutionFunction
impl PartialEq for SubstitutionFunction
impl StructuralPartialEq for SubstitutionFunction
Source§impl ToShmem for SubstitutionFunction
impl ToShmem for SubstitutionFunction
Auto Trait Implementations§
impl Freeze for SubstitutionFunction
impl RefUnwindSafe for SubstitutionFunction
impl Send for SubstitutionFunction
impl Sync for SubstitutionFunction
impl Unpin for SubstitutionFunction
impl UnsafeUnpin for SubstitutionFunction
impl UnwindSafe for SubstitutionFunction
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert