1 unstable release

0.1.0 Oct 1, 2022

#102 in macOS and iOS APIs

Download history 22/week @ 2024-07-29 20/week @ 2024-08-05 2/week @ 2024-08-12 12/week @ 2024-08-19 65/week @ 2024-08-26 13/week @ 2024-09-02 12/week @ 2024-09-09 10/week @ 2024-09-16 57/week @ 2024-09-23 102/week @ 2024-09-30 27/week @ 2024-10-07 34/week @ 2024-10-14 22/week @ 2024-10-21 10/week @ 2024-10-28 38/week @ 2024-11-04

105 downloads per month
Used in 4 crates (3 directly)

Apache-2.0 OR MIT

58KB
1K SLoC

dispatch2

Allows interaction with the Apple Dispatch library in a safe and unsafe way.

Usage

To use dispatch2, add this to your Cargo.toml:

[dependencies]
dispatch2 = "0.1.0"

Example

use dispatch2::{Queue, QueueAttribute};

fn main() {
    let queue = Queue::new("example_queue", QueueAttribute::Serial);
    queue.exec_async(|| println!("Hello"));
    queue.exec_sync(|| println!("World"));
}

License

dispatch2 is distributed under the terms of either the MIT license or the Apache License (Version 2.0), at the user's choice.

See LICENSE-APACHE and LICENSE-MIT.


lib.rs:

Apple Dispatch (Grand Central Dispatch)

This crate allows interaction with the Apple Dispatch library in a safe (dispatch2 module) and unsafe (ffi module) way.

Example:

use dispatch2::{Queue, QueueAttribute};

fn main() {
    let queue = Queue::new("example_queue", QueueAttribute::Serial);
    queue.exec_async(|| println!("Hello"));
    queue.exec_sync(|| println!("World"));
}

Dependencies