Skip to main content
Crate: aic-sdk = "=0.24.0". Core SDK: 0.24.0. The minimum Rust version is 1.88, using edition 2024. Source: the published aic-sdk and aic-sdk-sys crates.

Cargo features

No features are enabled by default. Static native linking is the default strategy, but a native library must still be supplied. Cargo features are additive across dependencies. If both linking features are enabled, runtime linking wins and the build emits a warning. Prefer selecting one explicitly. AIC_LIB_PATH identifies the SDK library directory for static/dynamic build-time linking; it is not the runtime load_library file path. With no download feature, build-time linking requires a local library. See the released linking guide for platform deployment details. For runtime loading and async processing, a minimal dependency declaration is:

load_library

Requires feature: runtime-linking.
Explicitly loads a native shared library before the first SDK operation. Safety: the file must be trusted and ABI-compatible with the bundled 0.24.0 header. Loading an incompatible library can cause undefined behavior. Checking a filename or a version string after loading does not establish ABI compatibility. The loaded library remains for the process lifetime. It cannot be safely replaced. A subsequent valid load returns AlreadyLoaded; the implementation attempts opening and resolving the supplied library before storing it, so an invalid subsequent path can return an open/symbol error first. If you omit this call, the first SDK operation loads the platform default filename through the OS loader search path (libaic.so, libaic.dylib or aic.dll). Automatic loading failure panics. Explicit loading lets you handle DynamicLoadingError before SDK use.

is_library_loaded

Requires feature: runtime-linking.
Reports whether this process has installed the SDK dynamic library. It does not trigger loading or prove SDK authorization.

DynamicLoadingError

Requires feature: runtime-linking. Reexported from aic_sdk_sys.
All named variant fields are public pattern-match payloads with the types shown above. path identifies the attempted file and symbol the missing native function. Both source fields preserve the platform loader error. The enum implements Debug, Display and std::error::Error; Error::source() returns the underlying loader error for the two payload variants and None for AlreadyLoaded. It is not Clone or Eq.

AicError

Returned by fallible wrapper operations. Implements Debug, Clone, PartialEq, Eq, Display and std::error::Error. Display provides diagnostic text; match variants rather than parsing those strings. ModelDownload carries text rather than a nested error source. The tuple payloads are available through pattern matching. ModelDownload exists even with download-model disabled, although the public downloader is then absent. There is no ParameterFixed variant in this release.

Panics and Result boundaries

Result covers ordinary native errors but is not a promise that no call can panic. Model/query/context functions assert native success. Model::from_file panics on an embedded NUL path. Worker initialization or unexpected worker channel loss can panic in async code. Runtime automatic loading can panic before the called SDK operation returns. Explicit loader handling and validated inputs keep these conditions distinct from routine processing errors.

Trait and conversion surface

Explicit conversions are:
Parameter conversions map the named variant to its C enum value. Result conversion copies all seven fields. Error conversion maps known failure codes and wraps other values in Unknown; the null-pointer error code panics as a wrapper invariant failure. Do not convert a native success code into an error: this conversion does not perform the success check used by fallible SDK methods. Naming the aic_sdk_sys types in application code requires that crate as a direct dependency; they are not root type reexports of aic_sdk. Rustdoc also lists standard blanket traits and other compiler-derived implementations.

Reserved integration hook: set_sdk_id

This public export is reserved for ai-coustics wrapper integrations, not application setup. Callers must use an ID assigned by ai-coustics. Application constructors already identify the Rust wrapper; do not override it. See the symbol index, authentication and troubleshooting.