sz_rust_sdk/
lib.rs

1//! # Senzing Rust SDK
2//!
3//! This crate provides a Rust interface to the Senzing entity resolution engine.
4//! It follows the same patterns as other Senzing SDKs while leveraging Rust's
5//! type safety and zero-cost abstractions.
6//!
7//! ## Architecture
8//!
9//! The SDK is organized around the following core traits:
10//! - [`SzEnvironment`] - Main entry point and factory for other components
11//! - [`SzEngine`] - Core entity resolution operations
12//! - [`SzConfig`] - Configuration management
13//! - [`SzConfigManager`] - Configuration lifecycle management
14//! - [`SzDiagnostic`] - System diagnostics and monitoring
15//! - [`SzProduct`] - Version and license information
16//!
17//! ## Usage
18//!
19//! ```rust,no_run
20//! use sz_rust_sdk::prelude::*;
21//!
22//! // Initialize the Senzing environment with proper settings
23//! let settings = r#"{
24//!     "PIPELINE": {
25//!         "CONFIGPATH": "/etc/opt/senzing",
26//!         "RESOURCEPATH": "/opt/senzing/er/resources",
27//!         "SUPPORTPATH": "/opt/senzing/data"
28//!     },
29//!     "SQL": {
30//!         "CONNECTION": "sqlite3://na:na@/tmp/G2C.db"
31//!     }
32//! }"#;
33//! let env = SzEnvironmentCore::new("my-app", settings, false)?;
34//!
35//! // Get the engine instance
36//! let engine = env.get_engine()?;
37//!
38//! // Add a record for entity resolution
39//! let result = engine.add_record(
40//!     "CUSTOMERS",
41//!     "CUST001",
42//!     r#"{"NAME_FULL": "John Smith", "EMAIL": "john@example.com"}"#,
43//!     None
44//! )?;
45//!
46//! println!("Entity resolution result: {}", result);
47//! # Ok::<(), Box<dyn std::error::Error>>(())
48//! ```
49
50pub mod core;
51pub mod error;
52mod error_mappings_generated; // Internal - generated error mappings used by error module
53mod ffi; // Internal FFI module - not part of public API
54pub mod flags;
55pub mod traits;
56pub mod types;
57
58// Internal helpers module - only for examples and tests, not part of public API
59// Hidden from documentation but accessible for internal use
60#[doc(hidden)]
61pub mod helpers;
62
63// Public API from core module
64pub use core::SenzingGuard;
65pub use core::SzEnvironmentCore;
66pub use error::*;
67pub use flags::*;
68pub use traits::*;
69pub use types::*;
70
71/// Prelude module for convenient imports
72///
73/// Import this to get access to all commonly used types:
74/// - [`SzEnvironmentCore`] - The main environment singleton
75/// - [`SenzingGuard`] - RAII wrapper for automatic cleanup
76/// - All traits ([`SzEngine`], [`SzConfig`], etc.)
77/// - Error types and result aliases
78/// - Flag types for controlling operations
79pub mod prelude {
80    pub use crate::core::SenzingGuard;
81    pub use crate::core::SzEnvironmentCore;
82    pub use crate::error::*;
83    pub use crate::flags::*;
84    pub use crate::traits::*;
85    pub use crate::types::*;
86}