pub struct Context<A: Assets> { /* 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.
Implementations§
source§impl<A: Assets> Context<A>
impl<A: Assets> Context<A>
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 assets_mut(&mut self) -> &mut Arc<A>
pub fn assets_mut(&mut self) -> &mut Arc<A>
A mutable reference to the assets to be served directly by Tauri.
sourcepub fn default_window_icon(&self) -> Option<&Icon>
pub fn default_window_icon(&self) -> Option<&Icon>
The default window icon Tauri should use when creating windows.
sourcepub fn default_window_icon_mut(&mut self) -> &mut Option<Icon>
pub fn default_window_icon_mut(&mut self) -> &mut Option<Icon>
A mutable reference to the default window icon Tauri should use when creating windows.
sourcepub fn tray_icon(&self) -> Option<&Icon>
Available on desktop
and crate feature tray-icon
only.
pub fn tray_icon(&self) -> Option<&Icon>
desktop
and crate feature tray-icon
only.The icon to use on the system tray UI.
sourcepub fn tray_icon_mut(&mut self) -> &mut Option<Icon>
Available on desktop
and crate feature tray-icon
only.
pub fn tray_icon_mut(&mut self) -> &mut Option<Icon>
desktop
and crate feature tray-icon
only.A mutable reference to the icon to use on the tray icon.
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: Arc<A>,
default_window_icon: Option<Icon>,
app_icon: Option<Vec<u8>>,
package_info: PackageInfo,
info_plist: (),
pattern: Pattern
) -> Self
pub fn new( config: Config, assets: Arc<A>, default_window_icon: Option<Icon>, app_icon: Option<Vec<u8>>, package_info: PackageInfo, info_plist: (), pattern: Pattern ) -> Self
Create a new Context
from the minimal required items.
sourcepub fn set_tray_icon(&mut self, icon: Icon)
Available on desktop
and crate feature tray-icon
only.
pub fn set_tray_icon(&mut self, icon: Icon)
desktop
and crate feature tray-icon
only.Sets the app tray icon.