pub trait TimerMethods: EvtHandlerMethods {
// Provided methods
fn get_id(&self) -> c_int { ... }
fn get_interval(&self) -> c_int { ... }
fn get_owner(&self) -> WeakRef<EvtHandler> { ... }
fn is_one_shot(&self) -> bool { ... }
fn is_running(&self) -> bool { ... }
fn notify(&self) { ... }
fn set_owner<E: EvtHandlerMethods>(&self, owner: Option<&E>, id: c_int) { ... }
fn start(&self, milliseconds: c_int, one_shot: bool) -> bool { ... }
fn start_once(&self, milliseconds: c_int) -> bool { ... }
fn stop(&self) { ... }
}
Expand description
This trait represents C++ wxTimer
class’s methods and inheritance.
See TimerIsOwned
documentation for the class usage.
Provided Methods§
Sourcefn get_interval(&self) -> c_int
fn get_interval(&self) -> c_int
Returns the current interval for the timer (in milliseconds).
Sourcefn get_owner(&self) -> WeakRef<EvtHandler>
fn get_owner(&self) -> WeakRef<EvtHandler>
Returns the current owner of the timer.
Sourcefn is_one_shot(&self) -> bool
fn is_one_shot(&self) -> bool
Returns true if the timer is one shot, i.e. if it will stop after firing the first notification automatically.
Sourcefn is_running(&self) -> bool
fn is_running(&self) -> bool
Returns true if the timer is running, false if it is stopped.
Sourcefn notify(&self)
fn notify(&self)
This member should be overridden by the user if the default constructor was used and SetOwner() wasn’t called.
Sourcefn set_owner<E: EvtHandlerMethods>(&self, owner: Option<&E>, id: c_int)
fn set_owner<E: EvtHandlerMethods>(&self, owner: Option<&E>, id: c_int)
Associates the timer with the given owner object.
Sourcefn start_once(&self, milliseconds: c_int) -> bool
fn start_once(&self, milliseconds: c_int) -> bool
Starts the timer for a once-only notification.
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.