#[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
Source§impl Drop for ThreadReceiver
impl Drop 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 UnsafeUnpin 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