2 unstable releases
0.2.0 | Jan 23, 2025 |
---|---|
0.1.0 | Oct 1, 2022 |
#217 in macOS and iOS APIs
4,637 downloads per month
Used in 7 crates
(6 directly)
1MB
18K
SLoC
dispatch2
Rust bindings to Apple's Grand Central Dispatch.
This README is kept intentionally small to consolidate the documentation, see the Rust docs for more details on this crate.
This crate is part of the objc2
project,
see that for related crates.
lib.rs
:
Apple's Dispatch (Grand Central Dispatch)
This crate provides a safe and sound interface to Apple's Grand Central
dispatch, as well as the ability to drop into lower-level bindings
([ffi
] module).
See Apple's documentation and the source code for libdispatch for more details.
Example
use dispatch2::{Queue, QueueAttribute};
let queue = Queue::new("example_queue", QueueAttribute::Serial);
queue.exec_async(|| println!("Hello"));
queue.exec_sync(|| println!("World"));