[lib] path = "src/_lib.rs" [package] name = "safer-ffi" version = "0.1.13" # Keep in sync authors = ["Daniel Henry-Mantilla "] edition = "2021" rust-version = "1.72.1" description = "Write safer FFI code in Rust without polluting it with unsafe code" keywords = ["ffi", "no_std", "framework", "safety", "bindings"] license = "MIT" repository = "https://github.com/getditto/safer_ffi" readme = "README.md" exclude = ["/guide"] [features] default = ["std"] # Document under the following features: all but for debug or experimental. docs = ["headers", "default", "nightly", "tokio"] nightly = [] alloc = [] std = ["alloc", "scopeguard/use_std", "stabby?/std"] proc_macros = [] # Deprecated async-fn = ["safer_ffi-proc_macros/async-fn"] 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"] serde = ["dep:serde"] stabby = ["dep:stabby"] tokio = ["async-compat", "dep:tokio", "futures"] headers = ["inventory", "safer_ffi-proc_macros/headers", "std"] python-headers = ["headers"] # Tweak the generated `.h` ever so slightly. c-headers-with-fn-style = ["headers"] # PRIVATE FEATURE / not part of crates.io package! js = [ "async-fn", "dep:once_cell", "headers", "inventory", "napi", "safer_ffi-proc_macros/js", # For convenience "std", ] # Deprecated: now always enabled, and thus does nothing. # TODO: remove in the next semver bump. inventory-0-3-1 = [] internal-tests = [ "async-fn", "headers", "python-headers", "dyn-traits", "tokio/rt-multi-thread", ] [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(docs)'] } [dev-dependencies] safer-ffi.path = "." safer-ffi.features = ["internal-tests"] rand = "0.8.5" serde_test = { version = "1.0.177" } [dependencies] async-compat.optional = true async-compat.version = "0.2.1" extern-c.version = "0.1.0" futures.optional = true futures.version = "0.3.24" inventory.optional = true inventory.version = "0.3.5" libc.version = "0.2.66" libc.default-features = false log.optional = true log.version = "0.4.8" macro_rules_attribute.version = "0.1.3" once_cell.optional = true once_cell.version = "1.17.1" paste.version = "1.0.12" scopeguard.version = "1.1.0" scopeguard.default-features = false serde.version = "1.0.171" serde.optional = true serde.default-features = false stabby.version = "36.1.1" stabby.optional = true stabby.default-features = false stabby.features = ["experimental-ctypes", "alloc-rs"] tokio.optional = true tokio.version = "1.26.0" tokio.features = ["rt"] uninit.version = "0.5.0" uninit.default-features = false unwind_safe.version = "0.1.0" with_builtin_macros.version = "0.0.3" # This dependency is not released to crates.io [dependencies.napi] optional = true path = "napi-dispatcher" package = "cratesio-placeholder-package" version = "0.0.3" [dependencies.safer_ffi-proc_macros] path = "src/proc_macro" version = "=0.1.13" # Keep in sync [workspace] members = [ "src/proc_macro", "napi-dispatcher", "napi-dispatcher/nodejs-derive", "napi-dispatcher/nodejs-derive/src/proc_macros", "napi-dispatcher/wasm", "napi-dispatcher/wasm/src/proc_macros", "safer-ffi-build", ] exclude = ["examples/point"] [package.metadata.docs.rs] features = ["docs"] [[test]] name = "ffi-tests" path = "ffi_tests/src/lib.rs"