Skip to main content

Module capability

Module capability 

Source
Expand description

Capability classification cache.

Stores (profile, bucket?, op) → CapabilityRecord in memory with a configurable TTL (default 30 minutes). Future tasks may add disk persistence via redb; the API surface is deliberately designed to accommodate that without changing call sites.

§OCP contract

  • Add a new capability class: add a CapabilityClass variant + one arm in record_from_error. Existing arms are untouched.
  • Add a new error pattern to classify: add one match arm inside record_from_error. The enum and store are unaffected.
  • Add a new scope for clear: add a ClearScope variant + one arm in CapabilityCache::clear. Existing scopes are untouched.
  • Storage-class extraction uses a small substring scan; new storage class names (e.g. DEEP_ARCHIVE_IA) are recognized automatically when they appear in the error message after "InvalidStorageClass" or "NoSuchTransition".

Structs§

CapabilityCache
In-memory capability classification cache.
CapabilityHandle
Arc wrapper so CapabilityCache can be registered as Tauri managed state.
CapabilityRecord
A cached capability result with the timestamp at which it was learned.
MockClock
Controllable clock for deterministic tests.
SystemClock 🔒

Enums§

CapabilityClass
Classification of a single S3 operation’s capability for a (profile, bucket?, op) triple.
ClearScope
What entries to remove when CapabilityCache::clear is called.

Constants§

DEFAULT_TTL_SECS 🔒
Default TTL for capability records: 30 minutes.

Traits§

Clock 🔒

Functions§

extract_storage_class 🔒
Extract the storage class name from a provider error message.

Type Aliases§

CacheKey 🔒
CapabilityMap
All known capabilities for a profile, keyed by "<bucket_or_empty>/<op>".