rio_window::platform::web

Trait CustomCursorExtWebSys

Source
pub trait CustomCursorExtWebSys {
    // Required methods
    fn is_animation(&self) -> bool;
    fn from_url(
        url: String,
        hotspot_x: u16,
        hotspot_y: u16,
    ) -> CustomCursorSource;
    fn from_animation(
        duration: Duration,
        cursors: Vec<CustomCursor>,
    ) -> Result<CustomCursorSource, BadAnimation>;
}

Required Methods§

Source

fn is_animation(&self) -> bool

Returns if this cursor is an animation.

Source

fn from_url(url: String, hotspot_x: u16, hotspot_y: u16) -> CustomCursorSource

Creates a new cursor from a URL pointing to an image. It uses the url css function, but browser support for image formats is inconsistent. Using PNG is recommended.

Source

fn from_animation( duration: Duration, cursors: Vec<CustomCursor>, ) -> Result<CustomCursorSource, BadAnimation>

Crates a new animated cursor from multiple CustomCursors. Supplied cursors can’t be empty or other animations.

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§