Trait tauri::Manager [−][src]
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 methods
Emits a event to all windows.
Emits an event to a window with the specified label.
Listen to a global event.
Listen to a global event only once.
fn trigger_global(&self, event: &str, data: Option<String>)
fn trigger_global(&self, event: &str, data: Option<String>)
Trigger a global event.
fn get_window(&self, label: &str) -> Option<Window<R>>
fn get_window(&self, label: &str) -> Option<Window<R>>
Fetch a single window from the manager.
Add state
to the state managed by the application.
See crate::Builder
for instructions.
Gets the managed state for the type T
. Panics if the type is not managed.