Skip to main content

ConditionallySend

Trait ConditionallySend 

Source
pub trait ConditionallySend: Sized {
    // Required methods
    fn can_send(&self) -> bool;
    fn wrap_send(self) -> Result<Sendable<Self>, Self>;
}

Required Methods§

Source

fn can_send(&self) -> bool

Returns true if the handle can be sent to another thread.

Source

fn wrap_send(self) -> Result<Sendable<Self>, Self>

Wrap the handle in a type that can be sent to another thread and unwrapped there.

Guaranteed to succeed of can_send() returns true.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<H> ConditionallySend for RCHandle<H>
where H: NativeRefCountedBase,

RCHandle<H> is conditionally Send and can be sent to another thread when its reference count is 1.