mirror of
https://github.com/bspeice/aeron-rs
synced 2026-06-13 00:01:38 -04:00
Start on an aeron-rs crate
This commit is contained in:
+2
-2
@@ -1,3 +1,3 @@
|
||||
[submodule "aeron"]
|
||||
path = aeron
|
||||
[submodule "aeron_driver-sys/aeron"]
|
||||
path = aeron_driver-sys/aeron
|
||||
url = https://github.com/real-logic/aeron
|
||||
|
||||
+5
-11
@@ -1,16 +1,10 @@
|
||||
[package]
|
||||
name = "libaeron_driver-sys"
|
||||
version = "0.1.0+1.21.2"
|
||||
name = "aeron-rs"
|
||||
version = "0.1.0"
|
||||
authors = ["Bradlee Speice <bradlee@speice.io>"]
|
||||
edition = "2018"
|
||||
links = "aeron_driver"
|
||||
build = "build.rs"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
|
||||
[build-dependencies]
|
||||
bindgen = "0.51"
|
||||
cmake = "0.1"
|
||||
|
||||
[features]
|
||||
static = []
|
||||
aeron_driver-sys = { path = "./aeron_driver-sys" }
|
||||
-1
Submodule aeron deleted from f3417fd5fb
@@ -0,0 +1 @@
|
||||
/target
|
||||
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "aeron_driver-sys"
|
||||
version = "0.1.0+1.21.2"
|
||||
authors = ["Bradlee Speice <bradlee@speice.io>"]
|
||||
edition = "2018"
|
||||
links = "aeron_driver"
|
||||
build = "build.rs"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[build-dependencies]
|
||||
bindgen = "0.51"
|
||||
cmake = "0.1"
|
||||
|
||||
[features]
|
||||
static = []
|
||||
@@ -52,7 +52,6 @@ pub fn main() {
|
||||
let bindings = bindgen::Builder::default()
|
||||
.clang_arg(&format!("-I{}", header_path.display()))
|
||||
.header("bindings.h")
|
||||
.whitelist_function("aeron_version_.*")
|
||||
.generate()
|
||||
.expect("Unable to generate aeron_driver bindings");
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
fn version_check() {
|
||||
let major = unsafe { crate::aeron_version_major() };
|
||||
let minor = unsafe { crate::aeron_version_minor() };
|
||||
let patch = unsafe { crate::aeron_version_patch() };
|
||||
assert_eq!(major, 1);
|
||||
assert_eq!(minor, 21);
|
||||
assert_eq!(patch, 2);
|
||||
}
|
||||
}
|
||||
+6
-17
@@ -1,19 +1,8 @@
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
fn version_check() {
|
||||
let major = unsafe { crate::aeron_version_major() };
|
||||
let minor = unsafe { crate::aeron_version_minor() };
|
||||
let patch = unsafe { crate::aeron_version_patch() };
|
||||
assert_eq!(major, 1);
|
||||
assert_eq!(minor, 21);
|
||||
assert_eq!(patch, 2);
|
||||
}
|
||||
pub fn aeron_version() -> (u32, u32, u32) {
|
||||
unsafe {(
|
||||
aeron_driver_sys::aeron_version_major() as u32,
|
||||
aeron_driver_sys::aeron_version_minor() as u32,
|
||||
aeron_driver_sys::aeron_version_patch() as u32,
|
||||
)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user