pub enum FontSourceUrl {
Str(String),
Asset(Asset),
}Expand description
The URL of a font file in a CSS url() entry.
An Asset is resolved to its hosted URL when formatted.
Both variants are escaped for use inside url("...").
Variants§
Str(String)
A URL supplied directly as a string.
Asset(Asset)
Available on crate feature
asset only.A bundled Asset, resolved to its hosted URL.
Implementations§
Source§impl FontSourceUrl
impl FontSourceUrl
Sourcepub fn fmt(&self, cx: &Cx, f: &mut dyn Write) -> Result
pub fn fmt(&self, cx: &Cx, f: &mut dyn Write) -> Result
Writes the URL, escaped as the body of a CSS <string> (without the
surrounding quotes).
§Errors
Returns any error produced while writing to f.
Trait Implementations§
Source§impl AttributeValueViewParts for FontSourceUrl
Available on crate feature view only.
impl AttributeValueViewParts for FontSourceUrl
Available on crate feature
view only.Source§fn attribute_present(&self) -> bool
fn attribute_present(&self) -> bool
Returns whether the containing attribute should be rendered. Read more
Source§fn into_view_parts(self, cx: &Cx, parts: &mut PartsWriter<'_>)
fn into_view_parts(self, cx: &Cx, parts: &mut PartsWriter<'_>)
Appends this attribute value to the view being built.
Source§impl Clone for FontSourceUrl
impl Clone for FontSourceUrl
Source§impl Debug for FontSourceUrl
impl Debug for FontSourceUrl
impl Eq for FontSourceUrl
Source§impl From<&str> for FontSourceUrl
impl From<&str> for FontSourceUrl
Source§impl From<Asset> for FontSourceUrl
Available on crate feature asset only.
impl From<Asset> for FontSourceUrl
Available on crate feature
asset only.Source§impl From<String> for FontSourceUrl
impl From<String> for FontSourceUrl
Source§impl Hash for FontSourceUrl
impl Hash for FontSourceUrl
Source§impl PartialEq for FontSourceUrl
impl PartialEq for FontSourceUrl
impl StructuralPartialEq for FontSourceUrl
Auto Trait Implementations§
impl Freeze for FontSourceUrl
impl RefUnwindSafe for FontSourceUrl
impl Send for FontSourceUrl
impl Sync for FontSourceUrl
impl Unpin for FontSourceUrl
impl UnsafeUnpin for FontSourceUrl
impl UnwindSafe for FontSourceUrl
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