Crates.io | send-sync-static |
lib.rs | send-sync-static |
version | 1.0.0 |
source | src |
created_at | 2023-10-08 16:38:41.173736 |
updated_at | 2023-10-08 16:38:41.173736 |
description | This crate fulfills the simple purpose of marking a type as Send, Sync, and 'static |
homepage | |
repository | https://github.com/A248/send-sync-static |
max_upload_size | |
id | 997252 |
size | 15,398 |
A very very basic crate, whose only purpose is to allow marking types Send + Sync + 'static
. No dependencies, no nothing. That's it.
The SSS
trait is a shortcut for Send + Sync + 'static
. Use it to mark a type as fulfilling these requirements. E.g.
pub async fn send_data<D>(data: D) where D: SSS {
// Do something here
}
You can also use FutureSSS
which is simply a shorthand for Future + 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)
}
}
Apache 2.0. This crate has so little code, it might not even be licensable.