Trait TimerMethods

Source
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§

Source

fn get_id(&self) -> c_int

Returns the ID of the events generated by this timer.

See C++ wxTimer::GetId()’s documentation.

Source

fn get_interval(&self) -> c_int

Returns the current interval for the timer (in milliseconds).

See C++ wxTimer::GetInterval()’s documentation.

Source

fn get_owner(&self) -> WeakRef<EvtHandler>

Returns the current owner of the timer.

See C++ wxTimer::GetOwner()’s documentation.

Source

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.

See C++ wxTimer::IsOneShot()’s documentation.

Source

fn is_running(&self) -> bool

Returns true if the timer is running, false if it is stopped.

See C++ wxTimer::IsRunning()’s documentation.

Source

fn notify(&self)

This member should be overridden by the user if the default constructor was used and SetOwner() wasn’t called.

See C++ wxTimer::Notify()’s documentation.

Source

fn set_owner<E: EvtHandlerMethods>(&self, owner: Option<&E>, id: c_int)

Associates the timer with the given owner object.

See C++ wxTimer::SetOwner()’s documentation.

Source

fn start(&self, milliseconds: c_int, one_shot: bool) -> bool

(Re)starts the timer.

See C++ wxTimer::Start()’s documentation.

Source

fn start_once(&self, milliseconds: c_int) -> bool

Starts the timer for a once-only notification.

See C++ wxTimer::StartOnce()’s documentation.

Source

fn stop(&self)

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§

Source§

impl<const OWNED: bool> TimerMethods for TimerIsOwned<OWNED>