iet-storage
Defines stream-based object contracts; authorization and tenant scoping remain caller policy.
iet-storagecontractsObject storage contractsHow to use it
iet-storage defines stream-based object contracts: ObjectStore (put/get/head/delete), the validated ObjectKey, ObjectMetadata/ObjectDownload, and ObjectPresigner for signed URLs. Authorization, tenant scoping, and streaming size limits are caller policies; no object-store adapter ships in this repository yet, so the closest real usage is the key contract itself.
// crates/core/iet-storage/src/lib.rs (inline #[cfg(test)] module)
use ObjectKey;
for key in
let key = new.unwrap;
assert_eq!;
ObjectKey::newrejects empty keys, >4096 bytes, leading/, backslashes, control characters, and./../empty path segments.getreturns anObjectDownloadcarryingmetadataplus a pinnedStream<Item = AppResult<Bytes>>; signed URLs fromObjectPresignerare bearer capabilities, so authorize before issuing and never log them.
How it works
An ObjectKey addresses objects in an ObjectStore, whose put, get, head, and delete methods operate on them; get yields an ObjectDownload, and ObjectPresigner mints time-limited URLs instead of streaming through the store.
flowchart LR A["ObjectKey::new"] --> B["ObjectStore"] B --> C["put"] B --> D["get"] B --> E["head"] B --> F["delete"] D --> G["ObjectDownload metadata and stream"] H["ObjectPresigner"] --> I["presign_get or presign_put"]
Core contract
This page is the crate reference. For the framework-wide runtime and trait model, read Architecture.
What it implements
- Defines the traits other crates implement:
ObjectStore,ObjectPresigner.
What's inside
Modules
src/lib.rs
Public API
(root)
- type
ObjectStream— Pinned concrete stream; boxing does not erase S or introduce a vtable. - struct
ObjectKey pub fn new(value: String) -> AppResult<Self>pub fn as_str(&self) -> &str- struct
ObjectMetadata - struct
ObjectDownload - trait
ObjectStore
- trait
ObjectPresigner— Signed URLs are bearer capabilities; authorize before issuing and never log them.
Depends on
External crates: bytes, futures-core
Used by
- No other framework crate depends on it directly.
In this repository
- Not used by a checked-in example yet.
Source: crates/core/iet-storage