#[repr(C)]pub struct ThreadReceiver {
pub ptr: Box<Arc<Mutex<ThreadReceiverInner>>>,
pub run_destructor: bool,
pub ctx: OptionRefAny,
}Expand description
Channel endpoint for receiving messages from the main thread in a background thread.
Thread-safe wrapper around the receiver end of a message channel.
Fields§
§ptr: Box<Arc<Mutex<ThreadReceiverInner>>>§run_destructor: bool§ctx: OptionRefAnyFor FFI: stores the foreign callable (e.g., PyFunction)
Implementations§
Source§impl ThreadReceiver
impl ThreadReceiver
Sourcepub fn new(t: ThreadReceiverInner) -> Self
pub fn new(t: ThreadReceiverInner) -> Self
Creates a new receiver wrapping the inner channel.
Sourcepub fn get_ctx(&self) -> OptionRefAny
pub fn get_ctx(&self) -> OptionRefAny
Get the FFI context (e.g., Python callable)
Sourcepub fn recv(&mut self) -> OptionThreadSendMsg
pub fn recv(&mut self) -> OptionThreadSendMsg
Receives a message from the main thread, if available.
Trait Implementations§
Source§impl Clone for ThreadReceiver
impl Clone for ThreadReceiver
Source§impl Debug for ThreadReceiver
impl Debug for ThreadReceiver
Auto Trait Implementations§
impl Freeze for ThreadReceiver
impl RefUnwindSafe for ThreadReceiver
impl Send for ThreadReceiver
impl Sync for ThreadReceiver
impl Unpin for ThreadReceiver
impl UnwindSafe for ThreadReceiver
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