querent_rs/
lib.rs

1//! Querent Rust Bridge
2//! Rust bridge for querent async RDF Knowledge Graph python library
3//!  - Providers a Rust async interface to the querent python library
4//!  - Interface ties to python module via pyo3
5//!
6//! # Example
7//! use qurent_rs::Querent;
8
9use once_cell::sync::OnceCell;
10use querent::errors::QuerentError;
11use tokio::runtime::{Builder, Runtime};
12
13pub mod callbacks;
14pub mod comm;
15pub mod config;
16pub mod cross;
17pub mod querent;
18#[cfg(test)]
19mod tests;
20pub mod util;
21
22pub fn tokio_runtime() -> Result<&'static Runtime, QuerentError> {
23	static RUNTIME: OnceCell<Runtime> = OnceCell::new();
24
25	RUNTIME.get_or_try_init(|| {
26		Builder::new_multi_thread()
27			.enable_all()
28			.build()
29			.map_err(|err| QuerentError::internal(err.to_string()))
30	})
31}