pub struct RunLoop {
pub platform_run_loop: Rc<PlatformRunLoop>,
}Fields§
§platform_run_loop: Rc<PlatformRunLoop>Implementations§
Source§impl RunLoop
impl RunLoop
pub fn new() -> Self
pub fn schedule<F>(&self, in_time: Duration, callback: F) -> Handlewhere
F: FnOnce() + 'static,
Sourcepub fn schedule_next<F>(&self, callback: F) -> Handlewhere
F: FnOnce() + 'static,
pub fn schedule_next<F>(&self, callback: F) -> Handlewhere
F: FnOnce() + 'static,
Convenience method to schedule callback on next run loop turn.
Sourcepub async fn wait(&self, duration: Duration)
pub async fn wait(&self, duration: Duration)
Returns future that will complete in provided duration.
pub fn run(&self)
pub fn stop(&self)
pub fn new_sender(&self) -> RunLoopSender
pub fn spawn<T: 'static>( &self, future: impl Future<Output = T> + 'static, ) -> JoinHandle<T> ⓘ
Auto Trait Implementations§
impl Freeze for RunLoop
impl !RefUnwindSafe for RunLoop
impl !Send for RunLoop
impl !Sync for RunLoop
impl Unpin for RunLoop
impl !UnwindSafe for RunLoop
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more