Trait wasm_ticker::TimerTicker

source ·
pub trait TimerTicker: NamedTicker {
    type Token: AsRef<JsValue> + Clone;

    // Required method
    fn token(&self) -> Option<Self::Token>;
}
Expand description

Tickers using JavaScript timer APIs.

Required Associated Types§

source

type Token: AsRef<JsValue> + Clone

Returned token type of JavaScript timer API like setTimeout.

In browsers, this usually is Number, but in Node it could be a Object.

Required Methods§

source

fn token(&self) -> Option<Self::Token>

Get clone of latest Self::Token if exists.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl TimerTicker for AnimationFrameTicker

source§

type Token = AnimationFrameToken

source§

impl TimerTicker for ImmediateTicker

source§

type Token = ImmediateToken

source§

impl TimerTicker for TimeoutTicker

source§

type Token = TimeoutToken