Skip to main content

IPlatformThreadingInterface

Trait IPlatformThreadingInterface 

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

Source

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.

Source

fn signal(&self, priority: DispatcherPriority)

Source

fn signal_handle(&self) -> Arc<dyn IPlatformThreadingSignal> ⓘ

The thread-safe handle that does what signal does.

Source

fn current_thread_is_loop_thread(&self) -> bool

Source

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".

Implementors§