send-sync-static 1.0.0

This crate fulfills the simple purpose of marking a type as Send, Sync, and 'static
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented2 out of 2 items with examples
  • Size
  • Source code size: 15.09 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 175.68 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • A248/send-sync-static
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • A248

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.

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)
    }
}

License

Apache 2.0. This crate has so little code, it might not even be licensable.