Module send_opt

Module send_opt 

Source
Expand description

Container like Option<T>, but Send even if T is not Send.

SendOption is useful for types which are composed of Send data, except for an optional field of a non-send type. The field is expected to be set and used only inside a particular thread, and will be None while sent across the thread boundary. Since Rust can’t prove any of that, using Option<NonSendType> for the field prevents the entire type from being Send. SendOption enforces the above guarantees at run time.

Structs§

SendOption
Like Option<T>, but Send even if T is not Send.