Skip to main content

Module file

Module file 

Source
Expand description

File access contract.

The runtime never touches storage itself. Nodes that need file bytes (document extraction, uploads, vision) ask the FileResolver registered in crate::node::Services as Arc<dyn FileResolver>. Hosts plug in their own storage (S3, blob store, database); this module provides an in-process resolver for inline data URLs and a ChainResolver to combine several.

Structs§

ChainResolver
Tries resolvers in order; the first one not returning Unsupported wins.
DataUrlResolver
Resolves inline files and any file whose url is a data: URL.
FileBytes
File content with its detected media type.

Enums§

FileError
Error reading or storing a file.

Traits§

FileResolver
Reads (and optionally stores) file content.

Functions§

base64_decode
Standard and URL-safe base64 decoder (padding optional, whitespace ignored).
base64_encode
Standard base64 encoder with padding.
decode_data_url
Decode a data:[<mime>][;base64],<payload> URL.