boxfnonce/lib.rs
1#![warn(missing_docs)]
2#![doc(html_root_url = "https://docs.rs/boxfnonce/0.1.1")]
3
4//! See `BoxFnOnce` and `SendBoxFnOnce`.
5
6/*
7This crate requires:
8a) A trait can dispatch through `self: Box<TraitName>` too: The "object-
9 safety" RFC[^1] lists the following arguments as "dispatchable":
10 `self`, `&self`, `&mut self`, or `self: Box<Self>`
11b) If you have a v: Box<T> for a concrete (`Sized`) type T, you can
12 extract the boxed value with *t (seems undocumented).
13
14This basically duplicates what Box<FnBox> is doing, but without using
15any unstable interface.
16
17[1]: https://github.com/rust-lang/rfcs/blob/master/text/0255-object-safety.md#detailed-design
18*/
19
20#[macro_use]
21mod macros;
22
23mod traits;
24
25mod no_send;
26pub use self::no_send::BoxFnOnce;
27
28mod send;
29pub use self::send::SendBoxFnOnce;