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<'de, V> Deserialize<'de> for MathFunction<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for MathFunction<V>where V: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<V: IsCompatible> IsCompatible for MathFunction<V>
impl<V: IsCompatible> IsCompatible for MathFunction<V>
source§fn is_compatible(&self, browsers: Browsers) -> bool
fn is_compatible(&self, browsers: Browsers) -> bool
Returns whether the value is compatible with all of the given browser targets.
source§impl<V: JsonSchema> JsonSchema for MathFunction<V>
impl<V: JsonSchema> JsonSchema for MathFunction<V>
source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresource§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
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<V> Serialize for MathFunction<V>where
V: Serialize,
impl<V> Serialize for MathFunction<V>where V: Serialize,
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 = _
Available on crate feature
visitor
only.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.
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.
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
§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