pub trait IPlatformThreadingInterface {
// Required methods
fn start_timer(
&self,
priority: DispatcherPriority,
interval: Duration,
tick: Rc<dyn Fn()>,
) -> PlatformTimerHandle;
fn signal(&self, priority: DispatcherPriority);
fn signal_handle(&self) -> Arc<dyn IPlatformThreadingSignal> ⓘ;
fn current_thread_is_loop_thread(&self) -> bool;
fn signaled(&self) -> &DispatcherImplEvent<Option<DispatcherPriority>>;
}Expand description
Provides platform-specific services relating to threading.
This is the legacy contract; platforms are expected to implement
IDispatcherImpl instead. Like that
contract it belongs to its loop thread, except for the handle returned by
signal_handle.
Required Methods§
Sourcefn start_timer(
&self,
priority: DispatcherPriority,
interval: Duration,
tick: Rc<dyn Fn()>,
) -> PlatformTimerHandle
fn start_timer( &self, priority: DispatcherPriority, interval: Duration, tick: Rc<dyn Fn()>, ) -> PlatformTimerHandle
Starts a timer.
tick is called on the loop thread every interval until the
returned value is disposed.
fn signal(&self, priority: DispatcherPriority)
Sourcefn signal_handle(&self) -> Arc<dyn IPlatformThreadingSignal> ⓘ
fn signal_handle(&self) -> Arc<dyn IPlatformThreadingSignal> ⓘ
The thread-safe handle that does what signal does.
fn current_thread_is_loop_thread(&self) -> bool
Sourcefn signaled(&self) -> &DispatcherImplEvent<Option<DispatcherPriority>>
fn signaled(&self) -> &DispatcherImplEvent<Option<DispatcherPriority>>
Raised on the loop thread in response to a signal.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".