#[non_exhaustive]pub struct AssetOptions { /* private fields */ }Available on crate feature
prelude only.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<AssetOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AssetOptions, <__D as Deserializer<'de>>::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§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 AssetOptions
impl SerializeConst 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
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
Source§impl<T> Pointable for T
impl<T> Pointable for T
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.