1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! `rete-graph` — the Rust library for [Rete](https://github.com/caviri/rete)
//! graph files, under the name it already has on PyPI and npm.
//!
//! This crate is a **facade**: every item is re-exported from
//! [`rete_core`](https://docs.rs/rete-core), which is where the engine actually
//! lives and where the implementation documentation belongs. Depending on either
//! gets you the same code; this one exists so that
//!
//! ```text
//! pip install rete-graph # Python
//! npm install rete-graph # JavaScript
//! cargo add rete-graph # Rust
//! ```
//!
//! all name the same thing. Before it existed, a Rust user following any of the
//! project's other install instructions had to know that the crate was called
//! something else.
//!
//! ## What this is NOT
//!
//! It does not pull in the whole workspace, because the three published crates
//! are not interchangeable:
//!
//! - **`rete-core`** is the library — what a Rust program depends on, and what
//! this crate re-exports.
//! - **`rete-cli`** is a *binary*. You install it (`cargo install rete-cli`);
//! depending on it from a library would drag an executable into your build for
//! nothing.
//! - **`rete-wasm`** is the browser binding, meaningful only on `wasm32`
//! targets.
//!
//! PyPI's and npm's `rete-graph` are likewise the *library* for their language,
//! not the CLI, so re-exporting the library is the faithful mapping.
//!
//! ## Features
//!
//! `compression` (default), `parallel` and `wasm-js` are forwarded verbatim to
//! `rete-core`, so this crate can be configured exactly like it.
//!
//! ## Example
//!
//! ```no_run
//! use rete_graph::Rete;
//!
//! let bytes = std::fs::read("graph.rete")?;
//! let graph = Rete::open(&bytes)?;
//! println!("{} quads", graph.dump(None).len());
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
pub use *;
/// The `rete-core` version this facade re-exports.
///
/// Identical to [`rete_core::VERSION`] by construction — the dependency is
/// pinned with `=`, so the two can never disagree — and re-stated here because a
/// caller who only knows `rete_graph` should not have to reach for another crate
/// to answer "which engine am I on?".
pub const ENGINE_VERSION: &str = VERSION;