Struct tauri::App
pub struct App<R: Runtime = Wry> { /* fields omitted */ }
Expand description
The instance of the currently running application.
This type implements Manager
which allows for manipulation of global application items.
#
ImplementationsRuntime> App<R>[src]#
impl<R:create_window<F>( &self, label: impl Into<String>, url: WindowUrl, setup: F ) -> Result<()> where F: FnOnce(<R::Dispatcher as Dispatch>::WindowBuilder, WebviewAttributes) -> (<R::Dispatcher as Dispatch>::WindowBuilder, WebviewAttributes),[src]#
pub fnCreates a new webview window.
path_resolver(&self) -> PathResolver[src]#
pub fnThe path resolver for the application.
global_shortcut_manager(&self) -> R::GlobalShortcutManager[src]#
pub fnGets a copy of the global shortcut manager instance.
clipboard_manager(&self) -> R::ClipboardManager[src]#
pub fnGets a copy of the clipboard manager instance.
config(&self) -> Arc<Config>[src]#
pub fnGets the app’s configuration, defined on the tauri.conf.json
file.
package_info(&self) -> &PackageInfo[src]#
pub fnGets the app’s package information.
Runtime> App<R>[src]#
impl<R:handle(&self) -> AppHandle<R>[src]#
pub fnGets a handle to the application instance.
run<F: Fn(&AppHandle<R>, Event) + 'static>(self, callback: F)[src]#
pub fnRuns the application.
#
Trait ImplementationsDebug + Runtime> Debug for App<R> where R::GlobalShortcutManager: Debug, R::ClipboardManager: Debug,[src]#
impl<R:fmt(&self, f: &mut Formatter<'_>) -> Result[src]#
fnFormats the value using the given formatter. Read more
Runtime> Manager<R> for App<R>[src]#
impl<R:config(&self) -> Arc<Config>[src]#
fnThe Config
the manager was created with.
emit_all<S: Serialize + Clone>(&self, event: &str, payload: S) -> Result<()>[src]#
fnEmits a event to all windows.
emit_to<S: Serialize + Clone>( &self, label: &str, event: &str, payload: S ) -> Result<()>[src]#
fnEmits an event to a window with the specified label.
listen_global<F>(&self, event: impl Into<String>, handler: F) -> EventHandler where F: Fn(EmittedEvent) + Send + 'static,[src]#
fnListen to a global event.
once_global<F>(&self, event: impl Into<String>, handler: F) -> EventHandler where F: Fn(EmittedEvent) + Send + 'static,[src]#
fnListen to a global event only once.
trigger_global(&self, event: &str, data: Option<String>)[src]#
fnTrigger a global event.
unlisten(&self, handler_id: EventHandler)[src]#
fnRemove an event listener.
get_window(&self, label: &str) -> Option<Window<R>>[src]#
fnFetch a single window from the manager.
windows(&self) -> HashMap<String, Window<R>>[src]#
fnFetch all managed windows.
manage<T>(&self, state: T) where T: Send + Sync + 'static,[src]#
fnAdd state
to the state managed by the application. See crate::Builder
for instructions. Read more
state<T>(&self) -> State<'_, T> where T: Send + Sync + 'static,[src]#
fnGets the managed state for the type T
. Panics if the type is not managed.
try_state<T>(&self) -> Option<State<'_, T>> where T: Send + Sync + 'static,[src]#
fnTries to get the managed state for the type T
. Returns None
if the type is not managed.
#
Auto Trait ImplementationsWry> \!RefUnwindSafe for App<R>#
impl<R =Send for App<R> where R: Send,#
impl<R>Sync for App<R> where R: Sync, <R as Runtime>::ClipboardManager: Sync, <R as Runtime>::GlobalShortcutManager: Sync, <R as Runtime>::Handle: Sync,#
impl<R>Unpin for App<R> where R: Unpin, <R as Runtime>::ClipboardManager: Unpin, <R as Runtime>::GlobalShortcutManager: Unpin, <R as Runtime>::Handle: Unpin,#
impl<R>Wry> \!UnwindSafe for App<R>#
impl<R =#
Blanket ImplementationsAny for T where T: 'static + ?Sized,[src]#
impl<T>type_id(&self) -> TypeId[src]#
pub fnGets the TypeId
of self
. Read more
Borrow<T> for T where T: ?Sized,[src]#
impl<T>borrow(&self) -> &T[src]#
pub fnImmutably borrows from an owned value. Read more
BorrowMut<T> for T where T: ?Sized,[src]#
impl<T>borrow_mut(&mut self) -> &mutT[src]#
pub fnMutably borrows from an owned value. Read more
From<T> for T[src]#
impl<T>from(t: T) -> T[src]#
pub fnPerforms the conversion.
Into<U> for T where U: From<T>,[src]#
impl<T, U>into(self) -> U[src]#
pub fnPerforms the conversion.
TryFrom<U> for T where U: Into<T>,[src]#
impl<T, U>Error = Infallible#
typeThe type returned in the event of a conversion error.
try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]#
pub fnPerforms the conversion.
TryInto<U> for T where U: TryFrom<T>,[src]#
impl<T, U>Error = <U as TryFrom<T>>::Error#
typeThe type returned in the event of a conversion error.
try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]#
pub fnPerforms the conversion.