Enum lightningcss::values::calc::MathFunction
source · pub enum MathFunction<V> {
Calc(Calc<V>),
Min(Vec<Calc<V>>),
Max(Vec<Calc<V>>),
Clamp(Calc<V>, Calc<V>, Calc<V>),
Round(RoundingStrategy, Calc<V>, Calc<V>),
Rem(Calc<V>, Calc<V>),
Mod(Calc<V>, Calc<V>),
Abs(Calc<V>),
Sign(Calc<V>),
Hypot(Vec<Calc<V>>),
}
Expand description
A CSS math function.
Math functions may be used in most properties and values that accept numeric values, including lengths, percentages, angles, times, etc.
Variants§
Calc(Calc<V>)
The calc()
function.
Min(Vec<Calc<V>>)
The min()
function.
Max(Vec<Calc<V>>)
The max()
function.
Clamp(Calc<V>, Calc<V>, Calc<V>)
The clamp()
function.
Round(RoundingStrategy, Calc<V>, Calc<V>)
The round()
function.
Rem(Calc<V>, Calc<V>)
The rem()
function.
Mod(Calc<V>, Calc<V>)
The mod()
function.
Abs(Calc<V>)
The abs()
function.
Sign(Calc<V>)
The sign()
function.
Hypot(Vec<Calc<V>>)
The hypot()
function.
Trait Implementations§
source§impl<V: Clone> Clone for MathFunction<V>
impl<V: Clone> Clone for MathFunction<V>
source§fn clone(&self) -> MathFunction<V>
fn clone(&self) -> MathFunction<V>
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<V: Debug> Debug for MathFunction<V>
impl<V: Debug> Debug for MathFunction<V>
source§impl<V: PartialEq> PartialEq<MathFunction<V>> for MathFunction<V>
impl<V: PartialEq> PartialEq<MathFunction<V>> for MathFunction<V>
source§fn eq(&self, other: &MathFunction<V>) -> bool
fn eq(&self, other: &MathFunction<V>) -> bool
source§impl<V: ToCss + Mul<f32, Output = V> + TrySign + Clone + Debug> ToCss for MathFunction<V>
impl<V: ToCss + Mul<f32, Output = V> + TrySign + Clone + Debug> ToCss for MathFunction<V>
source§fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError>where
W: Write,
fn to_css<W>(
&self,
dest: &mut Printer<'_, '_, '_, W>
) -> Result<(), PrinterError>where
W: Write,
Serialize
self
in CSS syntax, writing to dest
.source§fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
fn to_css_string(
&self,
options: PrinterOptions<'_>
) -> Result<String, PrinterError>
Serialize
self
in CSS syntax and return a string. Read moresource§impl<'i, V, __T: Visit<'i, __T, __V>, __V: Visitor<'i, __T>> Visit<'i, __T, __V> for MathFunction<V>where
V: Visit<'i, __T, __V>,
impl<'i, V, __T: Visit<'i, __T, __V>, __V: Visitor<'i, __T>> Visit<'i, __T, __V> for MathFunction<V>where
V: Visit<'i, __T, __V>,
source§const CHILD_TYPES: VisitTypes = _
const CHILD_TYPES: VisitTypes = _
The types of values contained within this value and its children.
This is used to skip branches that don’t have any values requested
by the Visitor. Read more
source§fn visit_children(&mut self, visitor: &mut __V)
fn visit_children(&mut self, visitor: &mut __V)
Visit the children of this value.
impl<V> StructuralPartialEq for MathFunction<V>
Auto Trait Implementations§
impl<V> RefUnwindSafe for MathFunction<V>where
V: RefUnwindSafe,
impl<V> Send for MathFunction<V>where
V: Send,
impl<V> Sync for MathFunction<V>where
V: Sync,
impl<V> Unpin for MathFunction<V>
impl<V> UnwindSafe for MathFunction<V>where
V: UnwindSafe,
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer