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§
Sourcefn is_animation(&self) -> bool
fn is_animation(&self) -> bool
Returns if this cursor is an animation.
Sourcefn from_url(url: String, hotspot_x: u16, hotspot_y: u16) -> CustomCursorSource
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.
Sourcefn from_animation(
duration: Duration,
cursors: Vec<CustomCursor>,
) -> Result<CustomCursorSource, BadAnimation>
fn from_animation( duration: Duration, cursors: Vec<CustomCursor>, ) -> Result<CustomCursorSource, BadAnimation>
Crates a new animated cursor from multiple CustomCursor
s.
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.