pub struct HandlerThread { /* private fields */ }
Expand description
HandlerThread
could receive FnMut
and run them on its own thread
.
It implements Handler
trait
simply and works well.
This is kind of facade which just handles thread
,
and bypasses jobs to HandlerThreadInner
(private implementations).
§Remarks
This is highly inspired by Android Handler
concepts.
Implementations§
Source§impl HandlerThread
impl HandlerThread
pub fn new() -> HandlerThread
pub fn new_with_mutex() -> Arc<Mutex<HandlerThread>>
Trait Implementations§
Source§impl Clone for HandlerThread
impl Clone for HandlerThread
Source§fn clone(&self) -> HandlerThread
fn clone(&self) -> HandlerThread
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 Default for HandlerThread
impl Default for HandlerThread
Source§impl Handler for HandlerThread
impl Handler for HandlerThread
Source§fn is_started(&mut self) -> bool
fn is_started(&mut self) -> bool
Did this
Handler
start?
Return true
when it did started (no matter it has stopped or not)Source§fn is_alive(&mut self) -> bool
fn is_alive(&mut self) -> bool
Is this
Handler
alive?
Return true
when it has started and not stopped yet.Auto Trait Implementations§
impl Freeze for HandlerThread
impl RefUnwindSafe for HandlerThread
impl Send for HandlerThread
impl Sync for HandlerThread
impl Unpin for HandlerThread
impl UnwindSafe for HandlerThread
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