pub struct CssAssetOptions { /* private fields */ }
Expand description
Options for a css asset
Implementations§
Source§impl CssAssetOptions
impl CssAssetOptions
Sourcepub const fn new() -> CssAssetOptions
pub const fn new() -> CssAssetOptions
Create a new css asset using the builder
Sourcepub const fn with_minify(self, minify: bool) -> CssAssetOptions
pub const fn with_minify(self, minify: bool) -> CssAssetOptions
Sets whether the css should be minified (default: true)
Minifying the css can make your site load faster by loading less data
const _: Asset = asset!("/assets/style.css", CssAssetOptions::new().with_minify(false));
Sourcepub const fn with_preload(self, preload: bool) -> CssAssetOptions
pub const fn with_preload(self, preload: bool) -> CssAssetOptions
Make the asset preloaded
Preloading css will make the image start to load as soon as possible. This is useful for css that is used soon after the page loads or css that may not be used immediately, but should start loading sooner
const _: Asset = asset!("/assets/style.css", CssAssetOptions::new().with_preload(true));
Sourcepub const fn into_asset_options(self) -> AssetOptions
pub const fn into_asset_options(self) -> AssetOptions
Convert the options into options for a generic asset
Trait Implementations§
Source§impl Clone for CssAssetOptions
impl Clone for CssAssetOptions
Source§fn clone(&self) -> CssAssetOptions
fn clone(&self) -> CssAssetOptions
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 CssAssetOptions
impl Debug for CssAssetOptions
Source§impl Default for CssAssetOptions
impl Default for CssAssetOptions
Source§fn default() -> CssAssetOptions
fn default() -> CssAssetOptions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CssAssetOptions
impl<'de> Deserialize<'de> for CssAssetOptions
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CssAssetOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CssAssetOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for CssAssetOptions
impl Hash for CssAssetOptions
Source§impl PartialEq for CssAssetOptions
impl PartialEq for CssAssetOptions
Source§impl PartialOrd for CssAssetOptions
impl PartialOrd for CssAssetOptions
Source§impl Serialize for CssAssetOptions
impl Serialize for CssAssetOptions
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl SerializeConst for CssAssetOptions
impl SerializeConst for CssAssetOptions
impl Copy for CssAssetOptions
impl StructuralPartialEq for CssAssetOptions
Auto Trait Implementations§
impl Freeze for CssAssetOptions
impl RefUnwindSafe for CssAssetOptions
impl Send for CssAssetOptions
impl Sync for CssAssetOptions
impl Unpin for CssAssetOptions
impl UnwindSafe for CssAssetOptions
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> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.