embroider 0.1.0

Text embroidery: Jina v5 text embeddings via ONNX Runtime (Rust core, optional PyO3 bindings) — shared by bobine and okfgraph
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! Error plumbing.
//!
//! anyhow carries everything. ort errors are stringified at every boundary:
//! `ort::Error` carries occurrences of non-Send/Sync payloads, so it cannot
//! travel in `anyhow::Error` directly (ort::Error is generic over the failing
//! stage; accept any Display).

/// Crate-wide result alias.
pub type Result<T> = anyhow::Result<T>;

/// Stringify any Display-able error into an anyhow error.
pub(crate) fn oe<T, E: std::fmt::Display>(r: std::result::Result<T, E>) -> Result<T> {
    r.map_err(|e| anyhow::anyhow!("{e}"))
}