Skip to content

Commit f39072e

Browse files
rustecal meta crate introduced
Meta crate
2 parents 8293ea5 + 442d84a commit f39072e

File tree

53 files changed

+240
-174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+240
-174
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
/.idea
12
/target
23
Cargo.lock

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
[workspace]
22
members = [
33
"rustecal",
4+
"rustecal-core",
5+
"rustecal-pubsub",
6+
"rustecal-service",
47
"rustecal-sys",
58
"rustecal-types-bytes",
69
"rustecal-types-protobuf",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ fn main() {
127127

128128
std::thread::sleep(std::time::Duration::from_secs(1));
129129
}
130+
130131
Ecal::finalize();
131132
}
132133
```

docs/src/project_structure.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
# Project Structure
22

3-
| Crate | Description |
4-
|-------|-------------|
5-
| `rustecal-sys` | Low-level unsafe bindings (via `bindgen`) |
6-
| `rustecal` | Safe and idiomatic high-level wrapper |
7-
| `rustecal-types-bytes` | Support for raw byte messages |
8-
| `rustecal-types-string` | UTF-8 string message support |
9-
| `rustecal-types-protobuf` | Protobuf support using `prost` |
10-
| `rustecal-samples` | Working binary examples |
3+
This workspace is organized into several purpose-specific crates to provide a modular, maintainable API for eCAL:
4+
5+
| Crate | Description |
6+
|---------------------------|----------------------------------------------------------|
7+
| `rustecal` | **Meta‑crate**: re‑exports core, pub/sub, and service APIs via feature flags (`pubsub`, `service`) |
8+
| `rustecal-core` | eCAL initialization, shutdown, and shared common types |
9+
| `rustecal-pubsub` | Typed and untyped Publisher/Subscriber API |
10+
| `rustecal-service` | RPC Service server & client API |
11+
| `rustecal-sys` | Low‑level FFI bindings to the eCAL C API |
12+
| `rustecal-types-string` | Helper: UTF-8 string message wrapper for typed pub/sub |
13+
| `rustecal-types-bytes` | Helper: raw byte vector message wrapper |
14+
| `rustecal-types-protobuf` | Helper: Protobuf message wrapper (using `prost`) |
15+
| `rustecal-samples` | Example binaries demonstrating pub/sub and RPC usage |
1116

1217
## Workspace Layout
1318

14-
```
19+
```text
1520
your_workspace/
16-
├── rustecal/
17-
├── rustecal-sys/
18-
├── rustecal-types-bytes/
21+
├── Cargo.toml # workspace manifest
22+
├── rustecal/ # meta‑crate (feature‑gated)
23+
├── rustecal-core/ # core init + types
24+
├── rustecal-pubsub/ # pub/sub API
25+
├── rustecal-service/ # service RPC API
26+
├── rustecal-sys/ # raw C bindings
1927
├── rustecal-types-string/
28+
├── rustecal-types-bytes/
2029
├── rustecal-types-protobuf/
21-
└── rustecal-samples/
22-
└── pubsub/
23-
├── blob_send/
24-
├── blob_receive/
25-
├── hello_send/
26-
├── hello_receive/
27-
├── person_send/
28-
└── person_receive/
29-
```
30+
└── rustecal-samples/ # examples
31+
├── pubsub/
32+
│ ├── hello_send/
33+
│ ├── hello_receive/
34+
│ ├── blob_send/
35+
│ ├── blob_receive/
36+
│ ├── person_send/
37+
│ └── person_receive/
38+
└── service/
39+
├── mirror_server/
40+
├── mirror_client/
41+
└── mirror_client_instances/

rustecal-core/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "rustecal-core"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
rustecal-sys = { path = "../rustecal-sys" }
9+
once_cell = "1.17"
10+
thiserror = "1.0"
11+
bitflags = "1.3"
12+
13+
[features]
14+
default = []
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! application and [`Ecal::finalize`] at shutdown.
1313
1414
use std::ffi::CString;
15-
use crate::ecal::components::EcalComponents;
15+
use crate::components::EcalComponents;
1616
use rustecal_sys;
1717

1818
/// Provides access to the core initialization and finalization functions of eCAL.

rustecal-core/src/lib.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//! rustecal-core: eCAL initialization & shared types
2+
3+
pub mod core;
4+
pub mod components;
5+
pub mod types;
6+
7+
// Re‑exports for ergonomic access:
8+
pub use core::Ecal;
9+
pub use components::EcalComponents;

rustecal-pubsub/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "rustecal-pubsub"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
rustecal-sys = { path = "../rustecal-sys" }
8+
rustecal-core = { path = "../rustecal-core" }
9+
thiserror = "1.0"
10+
serde = { version = "1.0", optional = true }
11+
12+
[features]
13+
default = []
14+
serde-support = ["serde"]

0 commit comments

Comments
 (0)