#[repr(C)]pub struct ThreadSender {
pub ptr: Box<Arc<Mutex<ThreadSenderInner>>>,
pub run_destructor: bool,
pub ctx: OptionRefAny,
}Expand description
ThreadSender allows sending messages from the background thread to the main thread
Fields§
§ptr: Box<Arc<Mutex<ThreadSenderInner>>>§run_destructor: bool§ctx: OptionRefAnyFor FFI: stores the foreign callable (e.g., PyFunction)
Implementations§
Source§impl ThreadSender
impl ThreadSender
pub fn new(t: ThreadSenderInner) -> Self
Sourcepub fn get_ctx(&self) -> OptionRefAny
pub fn get_ctx(&self) -> OptionRefAny
Get the FFI context (e.g., Python callable)
pub fn send(&mut self, msg: ThreadReceiveMsg) -> bool
Trait Implementations§
Source§impl Clone for ThreadSender
impl Clone for ThreadSender
Source§impl Debug for ThreadSender
impl Debug for ThreadSender
Auto Trait Implementations§
impl Freeze for ThreadSender
impl RefUnwindSafe for ThreadSender
impl Send for ThreadSender
impl Sync for ThreadSender
impl Unpin for ThreadSender
impl UnwindSafe for ThreadSender
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