Skip to main content

EventEmitter

Trait EventEmitter 

Source
pub trait EventEmitter {
    // Required method
    fn emit<P: Serialize + Clone>(
        &self,
        kind: EventKind,
        payload: P,
    ) -> Result<(), AppError>;
}
Expand description

Abstraction over anything that can emit Tauri-style events.

tauri::AppHandle implements this via the real Tauri runtime. MockChannel implements it for tests.

Required Methods§

Source

fn emit<P: Serialize + Clone>( &self, kind: EventKind, payload: P, ) -> Result<(), AppError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl EventEmitter for AppHandle

Source§

fn emit<P: Serialize + Clone>( &self, kind: EventKind, payload: P, ) -> Result<(), AppError>

Implementors§