Trait tauri::Manager
pub trait Manager<R: Runtime>: ManagerBase<R> {
fn config(&self) -> Arc<Config> { ... }
fn emit_all<S: Serialize + Clone>(
&self,
event: &str,
payload: S
) -> Result<()> { ... }
fn emit_to<S: Serialize + Clone>(
&self,
label: &str,
event: &str,
payload: S
) -> Result<()> { ... }
fn listen_global<F>(
&self,
event: impl Into<String>,
handler: F
) -> EventHandler
where
F: Fn(EmittedEvent) + Send + 'static,
{ ... }
fn once_global<F>(
&self,
event: impl Into<String>,
handler: F
) -> EventHandler
where
F: Fn(EmittedEvent) + Send + 'static,
{ ... }
fn trigger_global(&self, event: &str, data: Option<String>) { ... }
fn unlisten(&self, handler_id: EventHandler) { ... }
fn get_window(&self, label: &str) -> Option<Window<R>> { ... }
fn windows(&self) -> HashMap<String, Window<R>> { ... }
fn manage<T>(&self, state: T)
where
T: Send + Sync + 'static,
{ ... }
fn state<T>(&self) -> State<'_, T>
where
T: Send + Sync + 'static,
{ ... }
fn try_state<T>(&self) -> Option<State<'_, T>>
where
T: Send + Sync + 'static,
{ ... }
}
Expand description
Manages a running application.
#
Provided methodsconfig(&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.
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.