Struct style::font_face::FontFaceRuleData
source · pub struct FontFaceRuleData {
pub family: Option<FamilyName>,
pub sources: Option<Vec<Source>>,
pub source_location: SourceLocation,
}
Expand description
Data inside a @font-face
rule.
Fields§
§family: Option<FamilyName>
The name of this font face
sources: Option<Vec<Source>>
The alternative sources for this font face.
source_location: SourceLocation
Line and column of the @font-face rule source code.
Implementations§
source§impl FontFaceRuleData
impl FontFaceRuleData
sourcepub fn empty(location: SourceLocation) -> Self
pub fn empty(location: SourceLocation) -> Self
Create an empty font-face rule
sourcepub fn decl_to_css(&self, dest: &mut CssStringWriter) -> Result
pub fn decl_to_css(&self, dest: &mut CssStringWriter) -> Result
Serialization of declarations in the FontFaceRule
source§impl FontFaceRuleData
impl FontFaceRuleData
sourcepub fn font_face(&self) -> Option<FontFace<'_>>
pub fn font_face(&self) -> Option<FontFace<'_>>
Per https://github.com/w3c/csswg-drafts/issues/1133 an @font-face rule is valid as far as the CSS parser is concerned even if it doesn’t have a font-family or src declaration.
However both are required for the rule to represent an actual font face.
Trait Implementations§
source§impl Clone for FontFaceRuleData
impl Clone for FontFaceRuleData
source§fn clone(&self) -> FontFaceRuleData
fn clone(&self) -> FontFaceRuleData
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 Debug for FontFaceRuleData
impl Debug for FontFaceRuleData
source§impl PartialEq<FontFaceRuleData> for FontFaceRuleData
impl PartialEq<FontFaceRuleData> for FontFaceRuleData
source§fn eq(&self, other: &FontFaceRuleData) -> bool
fn eq(&self, other: &FontFaceRuleData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToCssWithGuard for FontFaceRuleData
impl ToCssWithGuard for FontFaceRuleData
source§fn to_css(
&self,
_guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter
) -> Result
fn to_css(
&self,
_guard: &SharedRwLockReadGuard<'_>,
dest: &mut CssStringWriter
) -> Result
Serialize
self
in CSS syntax, writing to dest
, using the given lock guard.source§fn to_css_string(&self, guard: &SharedRwLockReadGuard<'_>) -> CssString
fn to_css_string(&self, guard: &SharedRwLockReadGuard<'_>) -> CssString
Serialize
self
in CSS syntax using the given lock guard and return a string. Read moresource§impl ToShmem for FontFaceRuleData
impl ToShmem for FontFaceRuleData
impl StructuralPartialEq for FontFaceRuleData
Auto Trait Implementations§
impl RefUnwindSafe for FontFaceRuleData
impl Send for FontFaceRuleData
impl Sync for FontFaceRuleData
impl Unpin for FontFaceRuleData
impl UnwindSafe for FontFaceRuleData
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
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