Skip to main content

FileDialogBackend

Trait FileDialogBackend 

Source
pub trait FileDialogBackend {
    // Required method
    fn dispatch(
        &mut self,
        request_id: RequestId,
        window_id: TeksiloWindowId,
        request: FileDialogRequest,
        poster: Arc<dyn AppEventPoster>,
    );
}
Expand description

Swappable file-dialog backend. Mirrors the ClipboardBackend pattern.

The real backend (RfdAsyncBackend behind the rfd-backend feature) drives an rfd::AsyncFileDialog future on a worker thread; the test backend (MemoryFileDialog) returns scripted results synchronously.

Required Methods§

Source

fn dispatch( &mut self, request_id: RequestId, window_id: TeksiloWindowId, request: FileDialogRequest, poster: Arc<dyn AppEventPoster>, )

Spawn an async pick/save/folder request. The backend MUST eventually deliver the result by calling AppEventPoster::post_external on the supplied poster, with a boxed FileDialogEventPayload whose request_id matches the argument and whose window_id_owner is set to window_id.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§