Skip to main content

FrameSource

Trait FrameSource 

Source
pub trait FrameSource: Clone + 'static {
    // Required methods
    fn frame_slot(&self) -> Arc<Mutex<Option<Frame>>>;
    fn size_request_slot(&self) -> SizeRequestSlot;
    fn cursor(&self) -> Interaction;
    fn handle_event(
        &self,
        event: &Event,
        bounds: Rectangle,
        cursor: Cursor,
        focused: bool,
    ) -> bool;
}
Expand description

Trait that a frame source must implement to be rendered by FrameWidget.

Required Methods§

Source

fn frame_slot(&self) -> Arc<Mutex<Option<Frame>>>

Handle to the shared frame buffer.

Source

fn size_request_slot(&self) -> SizeRequestSlot

Slot the widget writes the current physical-pixel size into.

Source

fn cursor(&self) -> Interaction

Current cursor the source wants displayed.

Source

fn handle_event( &self, event: &Event, bounds: Rectangle, cursor: Cursor, focused: bool, ) -> bool

Called on every iced event. Returns true if consumed.

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.

Implementors§