Expand description
Verified artifact installation and dynamic loading for Alef native components.
§Downloads
DownloadOptions tunes timeouts, retries (transient errors only), progress reporting and
cancellation; pass it to ComponentManager::with_download_options or
ArtifactCache::with_download_options. The defaults match the historical 10 s connect and
300 s total timeouts.
§Root certificates
Downloads trust the compiled-in Mozilla roots (RootCerts::WebPki). Behind a TLS-inspecting
proxy, enable this crate’s platform-verifier feature and select
RootCerts::PlatformVerifier with DownloadOptions::with_root_certs to use the operating
system trust store. Requesting it without the feature fails the download with a clear error.
§Mirrors
A lock entry’s url is fixed when the lock is generated. Air-gapped and corporate hosts can
redirect downloads at runtime with ComponentManager::with_url_override (any
Fn(&ComponentLockEntry) -> String) or ComponentManager::with_mirror_base (serve every
archive as {base}/{archive file name}). Integrity does not depend on the URL: the archive
size and SHA-256 and the manifest signature are checked against the lock regardless of where
the bytes came from, so a mirror cannot substitute content.
§Cache maintenance
ComponentManager::list_cached, ComponentManager::remove and
ComponentManager::prune (with Retain) manage the shared on-disk cache. Loading an
object touches a last-used stamp so several host versions can share one cache and prune by
recency. Prune also sweeps crash leftovers (.install-* staging dirs, orphaned temp files and
stamps). Removal holds the object’s install lock, so an object another thread or process is
installing is skipped by prune and waited for by remove; the empty per-digest .lock files are
never deleted. Files Windows refuses to delete because a library is loaded are listed under
RemovalReport::skipped.
§Verified stamp
ComponentManager::with_verified_stamp (off by default) skips re-hashing an installed
library when a stamp recorded after a full check still matches the file’s size, mtime and, on
Unix, device, inode and ctime. See ArtifactCache::with_verified_stamp for what this does
and does not protect against. The stamp is ignored in a cache that other users can write.
Re-exports§
pub use stdio::SidecarRestartEvent;pub use stdio::SidecarSession;pub use stdio::SidecarSessionSetup;
Modules§
- stdio
- Framed stdio transport for bytes-only named component contracts.
- target
- Host target detection for native components.
Structs§
- Artifact
Cache - Cached
Artifact - Cached
Object - One installed object in the cache.
- Component
Artifact Record - Component
Identity - Component
Instance - A live instance created by a component, paired with its typed C function table.
- Component
Library - Component
Lock - Component
Lock Entry - Component
Manager - Component
Manifest - Component
Provided Contract - One contract a component provides, alongside the Rust type implementing it.
- Component
Requirements - What a loaded component’s descriptor must match.
- Component
Signature - Download
Options - How a component archive is downloaded.
- Infallible
Call Failure - A native component reported a failure from a contract method whose Rust signature cannot return an error.
- Loaded
Component - Removal
Report - What a removal or prune did.
- Retain
- Which objects
ComponentManager::prunekeeps. An object is kept when it satisfies any enabled criterion; with none enabled everything is removed. - Skipped
Removal - A path a cleanup could not remove, and why.
- Verifying
Key - An ed25519 public key.
Enums§
- Component
Delivery Mode - Whether a component is downloaded on demand or must be linked into the binding
ahead of time.
alef’s config-resolution code (alef::codegen::component) re-exports this type and exposes it on the resolved component config as a forward-looking hook; no loader or backend acts onBundledyet. - Component
Error - Component
Status - Where a configured component currently stands, independent of its on-disk location (see
ComponentManager::cache_pathfor that). Generated bindings expose this as both a stable string tag and a numeric code (alef_component_status/alef_component_status_codeinalef::backends::native_components) so callers in any host language can branch on it without parsing free-form text. - Root
Certs - Which trust anchors verify the TLS server certificate of a component download.
- Signature
Policy - Whether a component lock must carry signatures.
- Trust
Policy
Constants§
Traits§
- Host
Services - Services a host exposes to the components it loads.
Functions§
- canonical_
json - decode_
public_ key - Decode an Ed25519 public key from PEM, or from base64-encoded (standard or unpadded)
raw 32-byte / DER
SubjectPublicKeyInfobytes. - report_
infallible_ failure - Report a failure of an infallible contract method: to the hook set with
set_infallible_failure_hook, or to stderr when none is set. Generated proxies call this and then return the method’s default value. - set_
infallible_ failure_ hook - Replace the process-wide handler for
InfallibleCallFailures. The handler runs on the calling thread, before the proxy returns the default value; it may log, count, or panic if the host prefers to abort. It must not call back into the failing proxy. - take_
owned_ ⚠bytes - Copy an owned buffer’s bytes into a
Vec<u8>and release the original allocation through its ownfreecallback. - take_
owned_ ⚠text - Like
take_owned_bytes, but lossily decodes the bytes as UTF-8.
Type Aliases§
- Progress
Callback - Callback invoked as archive bytes stream in:
(downloaded, total), wheretotalis the archive size pinned by the lock entry.