Skip to content

(I hate this crate) A very basic crate, whose only purpose is to allow marking typesSend, Sync, and 'static.

License

Notifications You must be signed in to change notification settings

A248/send-sync-static

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

(I hate this crate) A very basic crate, whose only purpose is to allow marking typesSend, Sync, and 'static.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages