CyberMages LLC

Innovation Powered by Wizardry

binding (0.1.0)

Published 2025-07-29 20:26:34 -04:00 by myrddin

Installation

[registry]
default = "gitea"

[registries.gitea]
index = "sparse+" # Sparse index
# index = "" # Git

[net]
git-fetch-with-cli = true
cargo add binding@0.1.0

About this package

Defines macros and functions used when binding to C libraries.

Binding

binding is a foundational Rust crate providing safe and ergonomic abstractions for Foreign Function Interface (FFI) bindings. It serves as the core layer for building robust, cross-platform Rust bindings to native C APIs, enabling seamless integration between Rust and C codebases.


Features

  • Safe abstractions over unsafe FFI calls
  • Ergonomic trait-driven interfaces for common binding patterns
  • Cross-platform support for Windows and Linux
  • Designed with zero-cost abstractions in mind, maintaining performance
  • Facilitates building high-quality Rust wrappers around C libraries

Add to Your Project

This library is hosted on the CyberMages registry. To add it to your project, the CyberMages registry must be added to your Cargo configuration as described in the Cargo Book.

First, add the registry to your Cargo config (.cargo/config.toml or $CARGO_HOME/config.toml):

[registries.cybermages]
index = "sparse+https://workshop.cybermages.tech/api/packages/CyberMages/cargo/"

Then add binding as a dependency in your Cargo.toml:

[dependencies]
binding = { version = "0.x", registry = "cybermages" }

Getting Started

Motivation

Working with native C libraries from Rust often requires careful handling of unsafe code and complex boilerplate. The binding crate aims to reduce this friction by providing reusable, well-tested abstractions that improve safety, readability, and maintainability of Rust FFI code.


Copyright 2017 CyberMages LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS

Keywords

binding c types c enums c flags c strings
Details
Cargo
2025-07-29 20:26:34 -04:00
4
CyberMages LLC <Software@CyberMagesLLC.com>
Jason Travis Smith <Myrddin@CyberMages.tech>
Apache-2.0
9.8 KiB
Assets (1)
Versions (1) View all
0.1.0 2025-07-29