Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ABI-stable bytes::Bytes lookalike #215

Merged
merged 9 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 56 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 17 additions & 53 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,85 +3,50 @@ path = "src/_lib.rs"

[package]
name = "safer-ffi"
version = "0.1.8" # Keep in sync
authors = [
"Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>",
]
version = "0.1.8" # Keep in sync
authors = ["Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>"]
edition = "2021"

description = "Write safer FFI code in Rust without polluting it with unsafe code"
keywords = [
"ffi", "no_std", "framework", "safety", "bindings",
]
keywords = ["ffi", "no_std", "framework", "safety", "bindings"]
license = "MIT"
repository = "https://github.com/getditto/safer_ffi"

readme = "README.md"

exclude = [
"/guide",
]
exclude = ["/guide"]

[features]
default = [
"std",
]
default = ["std"]

# Document under the following features: all but for debug or experimental.
docs = [
"headers",
"default",
"nightly",
"tokio",
]
docs = ["headers", "default", "nightly", "tokio"]

nightly = []

alloc = []
std = [
"alloc",
"scopeguard/use_std",
]
std = ["alloc", "scopeguard/use_std"]

proc_macros = [] # Deprecated

async-fn = [
"safer_ffi-proc_macros/async-fn",
]
async-fn = ["safer_ffi-proc_macros/async-fn"]

debug_proc_macros = [
"safer_ffi-proc_macros/verbose-expansions",
]
debug_proc_macros = ["safer_ffi-proc_macros/verbose-expansions"]

dyn-traits = [
"safer_ffi-proc_macros/dyn-traits",
# FIXME: make this finer-grained
"std",
]

futures = [
"dep:futures",
"dyn-traits",
]
futures = ["dep:futures", "dyn-traits"]

tokio = [
"async-compat",
"dep:tokio",
"futures",
]
tokio = ["async-compat", "dep:tokio", "futures"]

headers = [
"inventory",
"safer_ffi-proc_macros/headers",
"std",
]
python-headers = [
"headers",
]
headers = ["inventory", "safer_ffi-proc_macros/headers", "std"]
python-headers = ["headers"]
# Tweak the generated `.h` ever so slightly.
c-headers-with-fn-style = [
"headers",
]
c-headers-with-fn-style = ["headers"]

# PRIVATE FEATURE / not part of crates.io package!
js = [
Expand Down Expand Up @@ -110,6 +75,7 @@ internal-tests = [
[dev-dependencies]
safer-ffi.path = "."
safer-ffi.features = ["internal-tests"]
rand = "0.8.5"
p-avital marked this conversation as resolved.
Show resolved Hide resolved

[dependencies]
async-compat.optional = true
Expand Down Expand Up @@ -139,9 +105,7 @@ scopeguard.default-features = false

tokio.optional = true
tokio.version = "1.26.0"
tokio.features = [
"rt",
]
tokio.features = ["rt"]

uninit.version = "0.5.0"
uninit.default-features = false
Expand All @@ -159,7 +123,7 @@ version = "0.0.3"

[dependencies.safer_ffi-proc_macros]
path = "src/proc_macro"
version = "=0.1.8" # Keep in sync
version = "=0.1.8" # Keep in sync

[workspace]
members = [
Expand Down
3 changes: 3 additions & 0 deletions src/_lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ mod tuple;
pub
mod option;

pub
mod bytes;
p-avital marked this conversation as resolved.
Show resolved Hide resolved

cfg_alloc! {
#[doc(inline)]
pub use string::String;
Expand Down
Loading
Loading