pub struct MainLoop<'a> { /* private fields */ }Implementations§
Source§impl<'a> MainLoop<'a>
impl<'a> MainLoop<'a>
pub fn terminate(&self)
pub fn call_asap<F: FnOnce() + 'a>(&self, f: F) -> Result<CbId, MainLoopError>
pub fn call_after<F: FnOnce() + 'a>( &self, d: Duration, f: F, ) -> Result<CbId, MainLoopError>
pub fn call_interval<F: FnMut() -> bool + 'a>( &self, d: Duration, f: F, ) -> Result<CbId, MainLoopError>
pub fn call_io<IO: IOAble + 'a>(&self, io: IO) -> Result<CbId, MainLoopError>
pub fn cancel(&self, cbid: CbId) -> bool
Sourcepub fn run_one(&mut self, allow_wait: bool) -> bool
pub fn run_one(&mut self, allow_wait: bool) -> bool
Runs the main loop once
Returns false if the mainloop was terminated.
Sourcepub fn new() -> Result<Self, MainLoopError>
pub fn new() -> Result<Self, MainLoopError>
Creates a new main loop
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for MainLoop<'a>
impl<'a> !RefUnwindSafe for MainLoop<'a>
impl<'a> !Send for MainLoop<'a>
impl<'a> !Sync for MainLoop<'a>
impl<'a> Unpin for MainLoop<'a>
impl<'a> !UnwindSafe for MainLoop<'a>
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