pub enum FontFamily<'a> {
Source(Cow<'a, str>),
Single(FontFamilyName<'a>),
List(Cow<'a, [FontFamilyName<'a>]>),
}Expand description
CSS font-family property value.
https://developer.mozilla.org/en-US/docs/Web/CSS/font-family
Variants§
Source(Cow<'a, str>)
Font family list in CSS format.
Single(FontFamilyName<'a>)
Single font family.
List(Cow<'a, [FontFamilyName<'a>]>)
Ordered list of font families.
Implementations§
Source§impl<'a> FontFamily<'a>
impl<'a> FontFamily<'a>
Sourcepub const fn named(name: &'a str) -> FontFamily<'a>
pub const fn named(name: &'a str) -> FontFamily<'a>
Creates a font-family value consisting of a single named family.
Sourcepub fn into_owned(self) -> FontFamily<'static>
pub fn into_owned(self) -> FontFamily<'static>
Returns an owned ('static) version of this font-family value.
This is useful when you want to store a FontFamily without borrowing from an input string
slice.
This allocates only if the value is borrowed (for example, Source(Cow::Borrowed) or
List(Cow::Borrowed)).
Trait Implementations§
Source§impl<'a> Clone for FontFamily<'a>
impl<'a> Clone for FontFamily<'a>
Source§fn clone(&self) -> FontFamily<'a>
fn clone(&self) -> FontFamily<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for FontFamily<'a>
impl<'a> Debug for FontFamily<'a>
impl<'a> Eq for FontFamily<'a>
Source§impl<'a> From<&'a [FontFamilyName<'a>]> for FontFamily<'a>
impl<'a> From<&'a [FontFamilyName<'a>]> for FontFamily<'a>
Source§fn from(fs: &'a [FontFamilyName<'a>]) -> FontFamily<'a>
fn from(fs: &'a [FontFamilyName<'a>]) -> FontFamily<'a>
Converts to this type from the input type.
Source§impl<'a> From<&'a str> for FontFamily<'a>
impl<'a> From<&'a str> for FontFamily<'a>
Source§fn from(s: &'a str) -> FontFamily<'a>
fn from(s: &'a str) -> FontFamily<'a>
Converts to this type from the input type.
Source§impl<'a> From<FontFamilyName<'a>> for FontFamily<'a>
impl<'a> From<FontFamilyName<'a>> for FontFamily<'a>
Source§fn from(f: FontFamilyName<'a>) -> FontFamily<'a>
fn from(f: FontFamilyName<'a>) -> FontFamily<'a>
Converts to this type from the input type.
Source§impl From<GenericFamily> for FontFamily<'_>
impl From<GenericFamily> for FontFamily<'_>
Source§fn from(f: GenericFamily) -> FontFamily<'_>
fn from(f: GenericFamily) -> FontFamily<'_>
Converts to this type from the input type.
Source§impl<'a> PartialEq for FontFamily<'a>
impl<'a> PartialEq for FontFamily<'a>
impl<'a> StructuralPartialEq for FontFamily<'a>
Auto Trait Implementations§
impl<'a> Forget for FontFamily<'a>
impl<'a> Freeze for FontFamily<'a>
impl<'a> Move for FontFamily<'a>
impl<'a> RefUnwindSafe for FontFamily<'a>
impl<'a> Send for FontFamily<'a>
impl<'a> Sync for FontFamily<'a>
impl<'a> Unpin for FontFamily<'a>
impl<'a> UnsafeUnpin for FontFamily<'a>
impl<'a> UnwindSafe for FontFamily<'a>
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