#[repr(C)]pub struct FontWeight(FontWeightFixedPoint);
Expand description
A value for the font-weight property per:
https://drafts.csswg.org/css-fonts-4/#propdef-font-weight
cbindgen:derive-lt cbindgen:derive-lte cbindgen:derive-gt cbindgen:derive-gte
Tuple Fields§
§0: FontWeightFixedPoint
Implementations§
source§impl FontWeight
impl FontWeight
sourcepub const NORMAL: FontWeight = _
pub const NORMAL: FontWeight = _
The normal
keyword.
sourcepub const BOLD: FontWeight = _
pub const BOLD: FontWeight = _
The bold
value.
sourcepub const BOLD_THRESHOLD: FontWeight = _
pub const BOLD_THRESHOLD: FontWeight = _
The threshold from which we consider a font bold.
sourcepub fn from_float(v: f32) -> Self
pub fn from_float(v: f32) -> Self
Construct a valid weight from a float value.
Trait Implementations§
source§impl Clone for FontWeight
impl Clone for FontWeight
source§fn clone(&self) -> FontWeight
fn clone(&self) -> FontWeight
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 ComputeSquaredDistance for FontWeight
impl ComputeSquaredDistance for FontWeight
source§fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
fn compute_squared_distance(&self, other: &Self) -> Result<SquaredDistance, ()>
Computes the squared distance between two animatable values.
source§impl Debug for FontWeight
impl Debug for FontWeight
source§impl<'de> Deserialize<'de> for FontWeight
impl<'de> Deserialize<'de> for FontWeight
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 Hash for FontWeight
impl Hash for FontWeight
source§impl MallocSizeOf for FontWeight
impl MallocSizeOf for FontWeight
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 FontWeight
impl PartialEq for FontWeight
source§fn eq(&self, other: &FontWeight) -> bool
fn eq(&self, other: &FontWeight) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for FontWeight
impl PartialOrd for FontWeight
source§fn partial_cmp(&self, other: &FontWeight) -> Option<Ordering>
fn partial_cmp(&self, other: &FontWeight) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for FontWeight
impl Serialize for FontWeight
source§impl ToAnimatedValue for FontWeight
impl ToAnimatedValue for FontWeight
§type AnimatedValue = f32
type AnimatedValue = f32
The type of the animated value.
source§fn to_animated_value(self, _: &Context<'_>) -> Self::AnimatedValue
fn to_animated_value(self, _: &Context<'_>) -> Self::AnimatedValue
Converts this value to an animated value.
source§fn from_animated_value(animated: Self::AnimatedValue) -> Self
fn from_animated_value(animated: Self::AnimatedValue) -> Self
Converts back an animated value into a computed value.
source§impl ToCss for FontWeight
impl ToCss for FontWeight
source§impl ToResolvedValue for FontWeight
impl ToResolvedValue for FontWeight
§type ResolvedValue = FontWeight
type ResolvedValue = FontWeight
The resolved value type we’re going to be converted to.
source§fn from_resolved_value(from: Self::ResolvedValue) -> Self
fn from_resolved_value(from: Self::ResolvedValue) -> Self
Convert a resolved value to resolved value form.
source§fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
fn to_resolved_value(self, context: &Context<'_>) -> Self::ResolvedValue
Convert a resolved value to a resolved value.
impl Copy for FontWeight
impl StructuralPartialEq for FontWeight
Auto Trait Implementations§
impl Freeze for FontWeight
impl RefUnwindSafe for FontWeight
impl Send for FontWeight
impl Sync for FontWeight
impl Unpin for FontWeight
impl UnwindSafe for FontWeight
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> 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