#[repr(C)]pub struct Thread {
pub ptr: Box<Arc<Mutex<ThreadInner>>>,
pub run_destructor: bool,
}Expand description
Wrapper around Thread because Thread needs to be clone-able
Fields§
§ptr: Box<Arc<Mutex<ThreadInner>>>§run_destructor: boolImplementations§
Source§impl Thread
impl Thread
pub fn new(ti: ThreadInner) -> Self
Sourcepub fn create<C: Into<ThreadCallback>>(
thread_initialize_data: RefAny,
writeback_data: RefAny,
callback: C,
) -> Self
pub fn create<C: Into<ThreadCallback>>( thread_initialize_data: RefAny, writeback_data: RefAny, callback: C, ) -> Self
Creates a new thread that will execute the given callback function.
§Arguments
thread_initialize_data- Data passed to the callback when the thread startswriteback_data- Data that will be passed back when writeback messages are receivedcallback- The callback to execute in the background thread
§Returns
A new Thread handle that can be added to the event loop with CallbackInfo::add_thread
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Thread
impl RefUnwindSafe for Thread
impl Send for Thread
impl Sync for Thread
impl Unpin for Thread
impl UnwindSafe for Thread
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more