Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/a248/send-sync-static
(I hate this crate) A very basic crate, whose only purpose is to allow marking typesSend, Sync, and 'static.
https://github.com/a248/send-sync-static
Last synced: 2 days ago
JSON representation
(I hate this crate) A very basic crate, whose only purpose is to allow marking typesSend, Sync, and 'static.
- Host: GitHub
- URL: https://github.com/a248/send-sync-static
- Owner: A248
- License: apache-2.0
- Created: 2023-10-08T16:36:23.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2023-10-08T16:38:55.000Z (about 1 year ago)
- Last Synced: 2024-12-08T21:18:53.061Z (26 days ago)
- Language: Rust
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# send-sync-static
A very very basic crate, whose only purpose is to allow marking types `Send + Sync + 'static`. No dependencies, no nothing. That's it.
### Usage
The `SSS` trait is a shortcut for `Send + Sync + 'static`. Use it to mark a type as fulfilling these requirements. E.g.
```rust
pub async fn send_data(data: D) where D: SSS {
// Do something here
}
```You can also use `FutureSSS` which is simply a shorthand for `Future + SSS`.
```rust
pub fn send_data(data: D) -> impl FutureSSS {
// Guarantees the async block is always Send, Sync, and 'static
async move {
// Do something here
drop(data)
}
}
```### License
Apache 2.0. This crate has so little code, it might not even be licensable.