Channel
A message channel used to stream values from Rust to the frontend.
A Channel is the JavaScript counterpart of tauri::ipc::Channel. Pass an instance as a command argument and the Rust command can declare a tauri::ipc::Channel<T> parameter with the same name; every value sent from Rust is then delivered to {@linkcode Channel.onmessage}. Messages are delivered in the order they were sent, even when they arrive out of order.
The channel stays alive until the Rust Channel is dropped, so it can be used for long-running work such as download progress or log streaming.
Raw byte payloads are delivered to the frontend as an ArrayBuffer rather than a JSON value, so declare the channel as Channel<ArrayBuffer> when the Rust side sends tauri::ipc::InvokeResponseBody::Raw — for example through a Channel<tauri::ipc::Response> whose values are built with tauri::ipc::Response::new(bytes).
Since
2.0.0