pub struct Descriptors {Show 14 fields
pub font_family: Option<FamilyName>,
pub src: Option<SourceList>,
pub font_style: Option<FontStyle>,
pub font_weight: Option<FontWeightRange>,
pub font_stretch: Option<FontStretchRange>,
pub font_display: Option<FontDisplay>,
pub unicode_range: Option<Vec<UnicodeRange>>,
pub font_feature_settings: Option<FontFeatureSettings>,
pub font_variation_settings: Option<FontVariationSettings>,
pub font_language_override: Option<FontLanguageOverride>,
pub ascent_override: Option<MetricsOverride>,
pub descent_override: Option<MetricsOverride>,
pub line_gap_override: Option<MetricsOverride>,
pub size_adjust: Option<NonNegativePercentage>,
}Expand description
All descriptor values.
Fields§
§font_family: Option<FamilyName>The “font-family” descriptor value.
src: Option<SourceList>The “src” descriptor value.
font_style: Option<FontStyle>The “font-style” descriptor value.
font_weight: Option<FontWeightRange>The “font-weight” descriptor value.
font_stretch: Option<FontStretchRange>The “font-stretch” descriptor value.
font_display: Option<FontDisplay>The “font-display” descriptor value.
unicode_range: Option<Vec<UnicodeRange>>The “unicode-range” descriptor value.
font_feature_settings: Option<FontFeatureSettings>The “font-feature-settings” descriptor value.
font_variation_settings: Option<FontVariationSettings>The “font-variation-settings” descriptor value.
font_language_override: Option<FontLanguageOverride>The “font-language-override” descriptor value.
ascent_override: Option<MetricsOverride>The “ascent-override” descriptor value.
descent_override: Option<MetricsOverride>The “descent-override” descriptor value.
line_gap_override: Option<MetricsOverride>The “line-gap-override” descriptor value.
size_adjust: Option<NonNegativePercentage>The “size-adjust” descriptor value.
Implementations§
Source§impl Descriptors
impl Descriptors
Sourcepub fn get(&self, id: DescriptorId, dest: &mut CssStringWriter) -> Result
pub fn get(&self, id: DescriptorId, dest: &mut CssStringWriter) -> Result
Gets a descriptor in CSS syntax.
Sourcepub fn set<'i, 't>(
&mut self,
id: DescriptorId,
context: &ParserContext<'_>,
input: &mut Parser<'i, 't>,
) -> Result<bool, ParseError<'i>>
pub fn set<'i, 't>( &mut self, id: DescriptorId, context: &ParserContext<'_>, input: &mut Parser<'i, 't>, ) -> Result<bool, ParseError<'i>>
Parses a given descriptor. Returns whether the descriptor changed.
Sourcepub fn remove(&mut self, id: DescriptorId) -> bool
pub fn remove(&mut self, id: DescriptorId) -> bool
Removes a descriptor. Returns true if it used to be set.
Sourcepub fn at(&self, i: usize) -> Option<DescriptorId>
pub fn at(&self, i: usize) -> Option<DescriptorId>
Returns the descriptor at position i.
Trait Implementations§
Source§impl Clone for Descriptors
impl Clone for Descriptors
Source§fn clone(&self) -> Descriptors
fn clone(&self) -> Descriptors
Returns a duplicate 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 Debug for Descriptors
impl Debug for Descriptors
Source§impl Default for Descriptors
impl Default for Descriptors
Source§fn default() -> Descriptors
fn default() -> Descriptors
Returns the “default value” for a type. Read more
Source§impl MallocSizeOf for Descriptors
impl MallocSizeOf for Descriptors
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 Descriptors
impl PartialEq for Descriptors
Source§impl ToCss for Descriptors
impl ToCss for Descriptors
Source§fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
fn to_css<W>(&self, dest: &mut CssWriter<'_, W>) -> Resultwhere
W: Write,
Serialize
self in CSS syntax, writing to dest.Source§fn to_css_string(&self) -> String
fn to_css_string(&self) -> String
Serialize
self in CSS syntax and return a string. Read moreSource§fn to_css_cssstring(&self) -> String
fn to_css_cssstring(&self) -> String
Serialize
self in CSS syntax and return a CssString. Read moreSource§impl ToShmem for Descriptors
impl ToShmem for Descriptors
impl StructuralPartialEq for Descriptors
Auto Trait Implementations§
impl Freeze for Descriptors
impl RefUnwindSafe for Descriptors
impl Send for Descriptors
impl Sync for Descriptors
impl Unpin for Descriptors
impl UnwindSafe for Descriptors
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,
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