Struct tauri::Context

source ·
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>

source

pub fn config(&self) -> &Config

The config the application was prepared with.

source

pub fn config_mut(&mut self) -> &mut Config

A mutable reference to the config the application was prepared with.

source

pub fn assets(&self) -> Arc<A>

The assets to be served directly by Tauri.

source

pub fn assets_mut(&mut self) -> &mut Arc<A>

A mutable reference to the assets to be served directly by Tauri.

source

pub fn default_window_icon(&self) -> Option<&Icon>

The default window icon Tauri should use when creating windows.

source

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.

source

pub fn system_tray_icon(&self) -> Option<&Icon>

The icon to use on the system tray UI.

source

pub fn system_tray_icon_mut(&mut self) -> &mut Option<Icon>

A mutable reference to the icon to use on the system tray UI.

source

pub fn package_info(&self) -> &PackageInfo

Package information.

source

pub fn package_info_mut(&mut self) -> &mut PackageInfo

A mutable reference to the package information.

source

pub fn pattern(&self) -> &Pattern

The application pattern.

source

pub fn allowed_commands(&self) -> &ShellScopeConfig

The scoped shell commands, where the HashMap key is the name each configuration.

source

pub fn new( config: Config, assets: Arc<A>, default_window_icon: Option<Icon>, app_icon: Option<Vec<u8>>, system_tray_icon: Option<Icon>, package_info: PackageInfo, info_plist: (), pattern: Pattern, shell_scope: ShellScopeConfig ) -> Self

Create a new Context from the minimal required items.

Trait Implementations§

source§

impl<A: Assets> Debug for Context<A>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<A> RefUnwindSafe for Context<A>
where A: RefUnwindSafe,

§

impl<A> Send for Context<A>

§

impl<A> Sync for Context<A>

§

impl<A> Unpin for Context<A>

§

impl<A> UnwindSafe for Context<A>
where A: RefUnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more