Expand description
Product-neutral ONNX Runtime dynamic-library resolution, environment and session setup for Right Suite apps.
Merged from ScrapeRight ort_common (installed-bundle layout, system-DLL
hazard) and HeardRight heardright-onnx-asr (environment, execution
providers, session builder). Product environment variables and data roots
stay in app adapters.
Re-exports§
pub use environment::cpu_thread_budget;pub use environment::init_environment;pub use environment::init_environment_with_options;pub use environment::EnvironmentInitOptions;pub use environment::EnvironmentInitReport;pub use environment::EnvironmentOptions;pub use environment::EnvironmentReport;pub use environment::EnvironmentStatus;pub use environment::GlobalPool;pub use probe::probe_providers;pub use probe::ProviderDiagnostic;pub use probe::ProviderKind;pub use session::BuiltSession;pub use session::ExecutionProvider;pub use session::SessionError;pub use session::SessionOptions;pub use ort;
Modules§
- environment
- Process-wide ORT environment initialisation (merged from HeardRight
heardright-onnx-asr/environment.rs, product experiment switches removed). - probe
- Execution-provider availability probe against the loaded runtime.
- session
- Session construction and execution-provider selection (merged from
HeardRight
heardright-onnx-asr/session.rs;HR_ONNX_*_EXPERIMENTenvironment switches dropped as product policy).
Structs§
- Candidate
Diagnostic - Runtime
Binding - Runtime
Binding Options - Binding policy; defaults retain strict file validation & conflict refusal.
- Runtime
Candidate - Runtime
Selection
Enums§
Functions§
- clear_
inherited_ runtime_ for_ release - Clear inherited
ORT_DYLIB_PATHin release builds; no-op in debug builds. This keeps shell-exported development paths from steering shipped apps, consistent with the policy that inheritedORT_DYLIB_PATHfails closed. - configure_
runtime - Configure ORT only after resolving a caller-supplied, absolute regular file. Existing configuration is preserved and must canonicalize to the same file.
- configure_
runtime_ with_ options - Bind explicit candidates under caller-selected policy. Available regular files win in caller order; missing mode falls back to the first absent path only when no file resolves. Missing paths retain their supplied absolute spelling because they cannot be canonicalized.
- configured_
runtime - Return the last path successfully bound by this crate for this process,
falling back to a non-empty
ORT_DYLIB_PATHwhen no binding is recorded. Read-only: no resolution, file check, environment mutation or ORT loading. Missing-mode bindings are included; this is not proof of a loaded library. - developer_
override_ candidate - Read a caller-named development override as an explicit runtime candidate.
Unset or empty values return
None; release builds always returnNonewithout reading the variable. Path validation remains in runtime resolution. - inspect_
candidate - installed_
resource_ dir - Resources directory of an installed application bundle, derived from its
executable only (no checkout or working-directory fallback):
macOS
Foo.app/Contents/MacOS/foo->Contents/Resources; Windows the executable directory; elsewhere<exe dir>/resources. - installed_
runtime_ candidate - Bundled-runtime candidate for an installed app:
<resources>/<subdir>/<runtime file>. Apps pass their ownsubdir(ScrapeRight/HeardRight/CodeRight all useruntime). - is_
system_ runtime - True when the path sits under a Windows
System32/SysWOW64directory. The OS copy ofonnxruntime.dll(Windows ML) hangs at session init, so it is never an acceptable candidate (ScrapeRightort_commonfinding). - legacy_
runtime_ candidate - Explicit legacy candidate; never searched unless the caller supplies it. Relative roots are rejected rather than resolved against process cwd.
- resolve_
runtime - runtime_
filename