Trait DynamicSend

pub unsafe trait DynamicSend: Send + Sealed {
    type Inner;

    // Required method
    fn extract_if_safe(self) -> Option<Self::Inner>;
}
Expand description

Runtime-checked Send capability.

Implemented for types that need a static Send bound, but where it is determined at runtime whether sending a value was actually safe. Only allows to extract the value if sending across threads is safe, thus fulfilling the Send supertrait.

§Safety

The implementor has to guarantee that extract_if_safe returns None, if the value has been sent between threads while being !Send.

To uphold the Send supertrait guarantees, no public API apart from extract_if_safe must exist that would give access to the inner value from another thread.

Required Associated Types§

type Inner

Required Methods§

fn extract_if_safe(self) -> Option<Self::Inner>

Implementations on Foreign Types§

§

impl DynamicSend for bool

§

impl DynamicSend for f32

§

impl DynamicSend for f64

§

impl DynamicSend for i8

§

impl DynamicSend for i16

§

impl DynamicSend for i32

§

impl DynamicSend for i64

§

impl DynamicSend for u8

§

impl DynamicSend for u16

§

impl DynamicSend for u32

§

impl DynamicSend for u64

§

impl DynamicSend for ()

§

impl<A1> DynamicSend for (A1,)
where A1: DynamicSend,

§

impl<A1, A2> DynamicSend for (A1, A2)
where A1: DynamicSend, A2: DynamicSend,

§

impl<A1, A2, A3> DynamicSend for (A1, A2, A3)
where A1: DynamicSend, A2: DynamicSend, A3: DynamicSend,

§

impl<A1, A2, A3, A4> DynamicSend for (A1, A2, A3, A4)

§

impl<A1, A2, A3, A4, A5> DynamicSend for (A1, A2, A3, A4, A5)

§

impl<A1, A2, A3, A4, A5, A6> DynamicSend for (A1, A2, A3, A4, A5, A6)

§

impl<A1, A2, A3, A4, A5, A6, A7> DynamicSend for (A1, A2, A3, A4, A5, A6, A7)

§

impl<A1, A2, A3, A4, A5, A6, A7, A8> DynamicSend for (A1, A2, A3, A4, A5, A6, A7, A8)

§

impl<A1, A2, A3, A4, A5, A6, A7, A8, A9> DynamicSend for (A1, A2, A3, A4, A5, A6, A7, A8, A9)

Implementors§