#[non_exhaustive]pub struct AssetOptions { /* private fields */ }Expand description
Settings for a generic asset
Implementations§
Source§impl AssetOptions
impl AssetOptions
Sourcepub const fn folder() -> AssetOptionsBuilder<FolderAssetOptions>
pub const fn folder() -> AssetOptionsBuilder<FolderAssetOptions>
Create a new folder asset builder
const _: Asset = asset!("/assets", AssetOptions::folder());Source§impl AssetOptions
impl AssetOptions
Sourcepub const fn image() -> AssetOptionsBuilder<ImageAssetOptions>
pub const fn image() -> AssetOptionsBuilder<ImageAssetOptions>
Create a new image asset builder
const _: Asset = asset!("/assets/image.png", AssetOptions::image());Source§impl AssetOptions
impl AssetOptions
Sourcepub const fn builder() -> AssetOptionsBuilder<()>
pub const fn builder() -> AssetOptionsBuilder<()>
Create a new asset options builder
Sourcepub const fn variant(&self) -> &AssetVariant
pub const fn variant(&self) -> &AssetVariant
Get the variant of the asset
Sourcepub const fn hash_suffix(&self) -> bool
pub const fn hash_suffix(&self) -> bool
Check if a hash should be added to the asset path
Sourcepub const fn extension(&self) -> Option<&'static str>
pub const fn extension(&self) -> Option<&'static str>
Try to get the extension for the asset. If the asset options don’t define an extension, this will return None
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
Source§impl AssetOptions
impl AssetOptions
Sourcepub const fn css() -> AssetOptionsBuilder<CssAssetOptions>
pub const fn css() -> AssetOptionsBuilder<CssAssetOptions>
Create a new css asset builder
const _: Asset = asset!("/assets/style.css", AssetOptions::css());Source§impl AssetOptions
impl AssetOptions
Sourcepub const fn js() -> AssetOptionsBuilder<JsAssetOptions>
pub const fn js() -> AssetOptionsBuilder<JsAssetOptions>
Create a new js asset builder
const _: Asset = asset!("/assets/script.js", AssetOptions::js());Source§impl AssetOptions
impl AssetOptions
Sourcepub const fn css_module() -> AssetOptionsBuilder<CssModuleAssetOptions>
pub const fn css_module() -> AssetOptionsBuilder<CssModuleAssetOptions>
Create a new css module asset builder
const _: Asset = asset!("/assets/style.css", AssetOptions::css_module());Trait Implementations§
Source§impl Clone for AssetOptions
impl Clone for AssetOptions
Source§fn clone(&self) -> AssetOptions
fn clone(&self) -> AssetOptions
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 AssetOptions
impl Debug for AssetOptions
Source§impl<'de> Deserialize<'de> for AssetOptions
impl<'de> Deserialize<'de> for AssetOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for AssetOptions
impl Hash for AssetOptions
Source§impl PartialEq for AssetOptions
impl PartialEq for AssetOptions
Source§impl PartialOrd for AssetOptions
impl PartialOrd for AssetOptions
Source§impl Serialize for AssetOptions
impl Serialize for AssetOptions
Source§impl SerializeConst for AssetOptions
impl SerializeConst for AssetOptions
impl Copy for AssetOptions
impl Eq for AssetOptions
impl StructuralPartialEq for AssetOptions
Auto Trait Implementations§
impl Freeze for AssetOptions
impl RefUnwindSafe for AssetOptions
impl Send for AssetOptions
impl Sync for AssetOptions
impl Unpin for AssetOptions
impl UnwindSafe for AssetOptions
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