Struct tauri_codegen::embedded_assets::EmbeddedAssets
source · pub struct EmbeddedAssets { /* private fields */ }Expand description
Represent a directory of assets that are compressed and embedded.
This is the compile time generation of [tauri_utils::assets::Assets] from a directory. Assets
from the directory are added as compiler dependencies by dummy including the original,
uncompressed assets.
The assets are compressed during this runtime, and can only be represented as a TokenStream
through ToTokens. The generated code is meant to be injected into an application to include
the compressed assets in that application’s binary.
Implementations§
source§impl EmbeddedAssets
impl EmbeddedAssets
sourcepub fn new(
input: impl Into<EmbeddedAssetsInput>,
options: &AssetOptions,
map: impl FnMut(&AssetKey, &Path, &mut Vec<u8>, &mut CspHashes) -> Result<(), EmbeddedAssetsError>,
) -> Result<Self, EmbeddedAssetsError>
pub fn new( input: impl Into<EmbeddedAssetsInput>, options: &AssetOptions, map: impl FnMut(&AssetKey, &Path, &mut Vec<u8>, &mut CspHashes) -> Result<(), EmbeddedAssetsError>, ) -> Result<Self, EmbeddedAssetsError>
Compress a collection of files and directories, ready to be generated into Assets.
Trait Implementations§
source§impl Default for EmbeddedAssets
impl Default for EmbeddedAssets
source§fn default() -> EmbeddedAssets
fn default() -> EmbeddedAssets
Returns the “default value” for a type. Read more
source§impl ToTokens for EmbeddedAssets
impl ToTokens for EmbeddedAssets
source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for EmbeddedAssets
impl RefUnwindSafe for EmbeddedAssets
impl Send for EmbeddedAssets
impl Sync for EmbeddedAssets
impl Unpin for EmbeddedAssets
impl UnwindSafe for EmbeddedAssets
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> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.