pub struct Context<R: Runtime = Wry> {
pub assets: Box<dyn Assets<R>>,
/* private fields */
}
Expand description
User supplied data required inside of a Tauri application.
§Stability
This is the output of the generate_context
macro, and is not considered part of the stable API.
Unless you know what you are doing and are prepared for this type to have breaking changes, do not create it yourself.
Fields§
§assets: Box<dyn Assets<R>>
Asset provider.
Implementations§
source§impl<R: Runtime> Context<R>
impl<R: Runtime> Context<R>
sourcepub fn config_mut(&mut self) -> &mut Config
pub fn config_mut(&mut self) -> &mut Config
A mutable reference to the config the application was prepared with.
sourcepub fn set_assets(&mut self, assets: Box<dyn Assets<R>>) -> Box<dyn Assets<R>>
pub fn set_assets(&mut self, assets: Box<dyn Assets<R>>) -> Box<dyn Assets<R>>
Replace the Assets
implementation and returns the previous value so you can use it as a fallback if desired.
sourcepub fn default_window_icon(&self) -> Option<&Image<'_>>
pub fn default_window_icon(&self) -> Option<&Image<'_>>
The default window icon Tauri should use when creating windows.
sourcepub fn set_default_window_icon(&mut self, icon: Option<Image<'static>>)
pub fn set_default_window_icon(&mut self, icon: Option<Image<'static>>)
Set the default window icon Tauri should use when creating windows.
sourcepub fn package_info(&self) -> &PackageInfo
pub fn package_info(&self) -> &PackageInfo
Package information.
sourcepub fn package_info_mut(&mut self) -> &mut PackageInfo
pub fn package_info_mut(&mut self) -> &mut PackageInfo
A mutable reference to the package information.
sourcepub fn new(
config: Config,
assets: Box<dyn Assets<R>>,
default_window_icon: Option<Image<'static>>,
app_icon: Option<Vec<u8>>,
package_info: PackageInfo,
info_plist: (),
pattern: Pattern,
runtime_authority: RuntimeAuthority,
plugin_global_api_scripts: Option<&'static [&'static str]>
) -> Self
pub fn new( config: Config, assets: Box<dyn Assets<R>>, default_window_icon: Option<Image<'static>>, app_icon: Option<Vec<u8>>, package_info: PackageInfo, info_plist: (), pattern: Pattern, runtime_authority: RuntimeAuthority, plugin_global_api_scripts: Option<&'static [&'static str]> ) -> Self
Create a new Context
from the minimal required items.
Trait Implementations§
Auto Trait Implementations§
impl<R = Wry<EventLoopMessage>> !Freeze for Context<R>
impl<R = Wry<EventLoopMessage>> !RefUnwindSafe for Context<R>
impl<R> Send for Context<R>
impl<R> Sync for Context<R>
impl<R> Unpin for Context<R>
impl<R = Wry<EventLoopMessage>> !UnwindSafe for Context<R>
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