1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//!
//! A very basic crate, whose only purpose is to allow marking types [`Send`], [`Sync`], and `'static`
//!
use Future;
///
/// A marker which identifies a type as [`Send`], [`Sync`], and `'static`.
/// This trait is automatically implemented for any types which fulfill these requirements,
/// and it is intended to be used as a shorthand for writing out each bound. For example:
/// ```
/// use send_sync_static::SSS;
/// pub async fn send_data<D>(data: D) where D: SSS {
/// // Do something here
/// }
/// ```
///
/// Code written explicitly using [`Send`], [`Sync`], and `'static` is fully interchangeable with this trait.
///
///
/// A marker which identifies a [`Future`] (but not necessarily its output) as [`Send`], [`Sync`], and `'static`.
///
/// This trait is automatically implemented for futures which fulfill these requirements,
/// and it is intended to be used as a shorthand for writing out each bound. For example:
/// ```
/// use send_sync_static::{FutureSSS, SSS};
/// pub fn send_data<D: SSS>(data: D) -> impl FutureSSS {
/// // Guarantees the async block is always Send, Sync, and 'static
/// async move {
/// // Do something here
/// drop(data)
/// }
/// }
/// ```
/// This can be combined with RPITIT, an upcoming stable feature.
/// ```ignore
/// use send_sync_static::FutureSSS;
/// pub trait Database {
/// fn add_user(&self, user: String) -> impl FutureSSS<Output = ()>;
/// }
/// ```
///
/// Code written explicitly using [`Send`], [`Sync`], and `'static` is fully interchangeable with this trait.
///