pub struct ThreadLoop { /* private fields */ }Expand description
Provides a main loop implementation which runs in a separate thread.
Implementations§
Source§impl ThreadLoop
impl ThreadLoop
Sourcepub fn new(props: &Properties) -> Option<ThreadLoop>
pub fn new(props: &Properties) -> Option<ThreadLoop>
Create a new thread main loop.
Sourcepub fn main_loop(&self) -> &MainLoop
pub fn main_loop(&self) -> &MainLoop
Access the underlying main loop.
This is only intended for managing the main loop sources, and methods such as
[MainLoop::run], [MainLoop::lock] etc. should not be called.
Sourcepub fn lock(&self) -> ThreadLoopGuard
pub fn lock(&self) -> ThreadLoopGuard
Take a lock on the thread main loop. While this lock is held, the main loop thread will not run any iterations. Conversely, taking the lock will block until the current main loop iteration has completed.
The lock is released when the returned ThreadLoopGuard is dropped.
Trait Implementations§
Source§impl Clone for ThreadLoop
impl Clone for ThreadLoop
Source§fn clone(&self) -> ThreadLoop
fn clone(&self) -> ThreadLoop
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Refcounted for ThreadLoop
impl Refcounted for ThreadLoop
Source§type WeakRef = WeakThreadLoop
type WeakRef = WeakThreadLoop
The type of a weak reference to the object
Source§fn upgrade(this: &Self::WeakRef) -> Option<Self>
fn upgrade(this: &Self::WeakRef) -> Option<Self>
Try to convert a weak reference to a strong reference. If the underlying object isstill
alive, returns a
Some continaing the value. If the underlying object’s strong reference
count dropped to zero, and was thus freed, this returns None.Source§fn downgrade(&self) -> Self::WeakRef
fn downgrade(&self) -> Self::WeakRef
Create a weak reference to the object. This reference does not impact the object’s
lifecycle, and merely allows us the option to try to retrieve the object using
Self::upgrade().
impl Send for ThreadLoop
impl Sync for ThreadLoop
Auto Trait Implementations§
impl Freeze for ThreadLoop
impl !RefUnwindSafe for ThreadLoop
impl Unpin for ThreadLoop
impl !UnwindSafe for ThreadLoop
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