pub enum BuiltinMacroFunction {
Min,
Max,
Clamp,
Mod,
Abs,
CubicBezier,
Rgb,
Hsv,
Debug,
}
Expand description
A builtin function which is handled by the compiler pass
Builtin function expect their arguments in one and a specific type, so that’s easier for the generator. Macro however can do some transformation on their argument.
Variants§
Min
Transform min(a, b, c, ..., z)
into a series of conditional expression and comparisons
Max
Transform max(a, b, c, ..., z)
into a series of conditional expression and comparisons
Clamp
Transforms clamp(v, min, max)
into a series of min/max calls
Mod
Add the right conversion operations so that the return type is the same as the argument type
Abs
Add the right conversion operations so that the return type is the same as the argument type
CubicBezier
Rgb
The argument can be r,g,b,a or r,g,b and they can be percentages or integer. transform the argument so it is always rgb(r, g, b, a) with r, g, b between 0 and 255.
Hsv
Debug
transform debug(a, b, c)
into debug a + " " + b + " " + c
Trait Implementations§
Source§impl Clone for BuiltinMacroFunction
impl Clone for BuiltinMacroFunction
Source§fn clone(&self) -> BuiltinMacroFunction
fn clone(&self) -> BuiltinMacroFunction
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BuiltinMacroFunction
impl Debug for BuiltinMacroFunction
Source§impl From<BuiltinMacroFunction> for LookupResult
impl From<BuiltinMacroFunction> for LookupResult
Source§fn from(macro_function: BuiltinMacroFunction) -> Self
fn from(macro_function: BuiltinMacroFunction) -> Self
Auto Trait Implementations§
impl Freeze for BuiltinMacroFunction
impl RefUnwindSafe for BuiltinMacroFunction
impl Send for BuiltinMacroFunction
impl Sync for BuiltinMacroFunction
impl Unpin for BuiltinMacroFunction
impl UnwindSafe for BuiltinMacroFunction
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
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>
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>
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