-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add to CI. - Update to 2021 edition. - Support visionOS and watchOS. - Align Cargo.toml metadata with the rest of the project. - Fix typos. - Appease Clippy. - Prefer `Box::into_raw` over `Box::leak`. - Consolidate documentation. Part of #77.
- Loading branch information
Showing
16 changed files
with
156 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Changelog | ||
|
||
Notable changes to this crate will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). | ||
|
||
## Unreleased - YYYY-MM-DD | ||
|
||
### Changed | ||
- Moved to the `objc2` project. | ||
|
||
|
||
## 0.1.0 - 2022-10-02 | ||
|
||
Initial version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,42 @@ | ||
[package] | ||
name = "dispatch2" | ||
version = "0.1.0" | ||
authors = ["Mary <[email protected]>"] | ||
version = "0.1.0" # Remember to update html_root_url in lib.rs | ||
description = "Bindings and wrappers for Apple's Grand Central Dispatch (GCD)" | ||
keywords = ["gcd", "macos", "ios", "dispatch", "libdispatch"] | ||
categories = [ | ||
"api-bindings", | ||
"development-tools::ffi", | ||
"os::macos-apis", | ||
"external-ffi-bindings", | ||
] | ||
authors = ["Mads Marquart <[email protected]>", "Mary <[email protected]>"] | ||
edition.workspace = true | ||
rust-version.workspace = true | ||
repository.workspace = true | ||
license = "Apache-2.0 OR MIT" | ||
repository = "https://www.github.com/marysaka/dispatch2.git" | ||
homepage = "https://www.github.com/marysaka/dispatch2" | ||
description = "Bindings and wrappers for the Grand Central Dispatch (GCD)" | ||
keywords = ["gcd", "macOS", "iOS", "watchOS", "ipadOS"] | ||
categories = ["api-bindings", "development-tools::ffi", "os::macos-apis"] | ||
edition = "2021" | ||
|
||
exclude = [ | ||
".github" | ||
] | ||
[lints] | ||
workspace = true | ||
|
||
[dependencies] | ||
libc = "0.2" | ||
|
||
[package.metadata.docs.rs] | ||
default-target = "aarch64-apple-darwin" | ||
features = [] | ||
targets = [ | ||
"aarch64-apple-darwin", | ||
"x86_64-apple-darwin", | ||
"aarch64-apple-ios", | ||
"x86_64-apple-ios", | ||
"aarch64-apple-tvos", | ||
"aarch64-apple-watchos", | ||
"aarch64-apple-ios-macabi", | ||
"x86_64-unknown-linux-gnu", | ||
"i686-unknown-linux-gnu", | ||
] | ||
|
||
[package.metadata.release] | ||
shared-version = false | ||
tag-prefix = "dispatch" | ||
enable-features = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
# dispatch2 | ||
# `dispatch2` | ||
|
||
Allows interaction with the [Apple Dispatch](https://developer.apple.com/documentation/dispatch) library in a safe and unsafe way. | ||
[![Latest version](https://badgen.net/crates/v/dispatch2)](https://crates.io/crates/dispatch2) | ||
[![License](https://badgen.net/static/license/MIT%20OR%20Apache%202.0/blue)](https://github.com/madsmtm/objc2/blob/master/LICENSE.txt) | ||
[![Documentation](https://docs.rs/dispatch2/badge.svg)](https://docs.rs/dispatch2/) | ||
[![CI](https://github.com/madsmtm/objc2/actions/workflows/ci.yml/badge.svg)](https://github.com/madsmtm/objc2/actions/workflows/ci.yml) | ||
|
||
## Usage | ||
Apple's Grand Central Dispatch interface in Rust. | ||
|
||
To use `dispatch2`, add this to your `Cargo.toml`: | ||
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. | ||
|
||
```toml | ||
[dependencies] | ||
dispatch2 = "0.1.0" | ||
``` | ||
This README is kept intentionally small in an effort to consolidate the | ||
documentation, see [the Rust docs](https://docs.rs/dispatch2/) for more details. | ||
|
||
## Example | ||
|
||
```rust | ||
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](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT). | ||
This crate is part of the [`objc2` project](https://github.com/madsmtm/objc2), | ||
see that for related crates. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.