pub enum Dispatch {
Effect {
request_id: String,
kind: String,
payload: Value,
},
WidgetOp {
op: String,
payload: Value,
},
Window(WindowOp),
WindowQuery(WindowQuery),
System(SystemOp),
SystemQuery(SystemQuery),
Image {
op: String,
handle: String,
data: Option<Vec<u8>>,
pixels: Option<Vec<u8>>,
width: Option<u32>,
height: Option<u32>,
},
}Expand description
Platform or widget operations the host must execute on Core’s behalf. Core doesn’t touch iced, stdout, or the filesystem; it produces these typed commands and the host dispatches them.
Variants§
Effect
Handle a platform effect (file dialog, clipboard, notification).
Core does not execute effects; it passes the raw request through for the host to dispatch. The host decides whether to run the effect synchronously, asynchronously (via Task::perform), or return unsupported (e.g. in headless mode where file dialogs are unavailable).
§Known effect kinds
Async (file dialogs): file_open, file_open_multiple,
file_save, directory_select, directory_select_multiple
Sync (clipboard): clipboard_read, clipboard_write,
clipboard_read_html, clipboard_write_html, clipboard_clear,
clipboard_read_primary, clipboard_write_primary
Sync (notification): notification
WidgetOp
Renderer-internal widget-targeted operation by op string.
Covers focus, scroll, cursor, pane-grid ops, tree_hash queries, list_images, load_font, announce, exit, find_focused.
Window(WindowOp)
Typed window operation (open, close, resize, move, …).
WindowQuery(WindowQuery)
Typed window query (get_size, get_position, …).
System(SystemOp)
Typed system-wide operation.
SystemQuery(SystemQuery)
Typed system-wide query.
Image
Image registry operation that targets a specific handle.
§Known ops
create_image, update_image, delete_image. Registry-level
ops without per-image fields (list, clear) re-emit as
WidgetOp and share the existing handlers.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Dispatch
impl RefUnwindSafe for Dispatch
impl Send for Dispatch
impl Sync for Dispatch
impl Unpin for Dispatch
impl UnsafeUnpin for Dispatch
impl UnwindSafe for Dispatch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.