use std::marker::PhantomData;
use crate::bridge::ffi;
#[derive(Debug)]
pub struct RunLoopHandle {
_not_send: PhantomData<*mut ()>,
}
impl RunLoopHandle {
#[must_use]
pub fn current() -> Self {
Self { _not_send: PhantomData }
}
#[allow(clippy::unused_self, reason = "method syntax ties ticking to a run-loop handle")]
pub fn tick(&self) {
ffi::currentThreadRunLoopTick();
}
#[allow(clippy::unused_self, reason = "method syntax ties waiting to a run-loop handle")]
pub(crate) fn wait_for_event(&self) {
ffi::currentThreadRunLoopWait();
}
#[allow(clippy::unused_self, reason = "method syntax ties stopping to a run-loop handle")]
pub(crate) fn stop(&self) {
ffi::currentThreadRunLoopStop();
}
}