Expand description
§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"));
Re-exports§
Modules§
- ffi
- Raw bindings to Apple’s Grand Central Dispatch (GCD).
- group
- Dispatch group definition.
- object
- Dispatch object definition.
- queue
- Dispatch queue definition.
- semaphore
- Dispatch semaphore definition.
Structs§
- Main
Thread Bound - Make a type that can only be used on the main thread be
Send
+Sync
. - Once
- A low-level synchronization primitive for one-time global execution.
Enums§
- Quality
OfService Class - Quality of service that specify the priorities for executing tasks.
- Wait
Error - Wait error.
Functions§
- run_
on_ main - Submit the given closure to the runloop on the main thread.