Expand description
Bucket and object listing helpers, plus region discovery.
§Responsibilities
BucketSummary— IPC-safe view returned to the frontend.list_buckets— wrapsListBuckets, maps toVec<BucketSummary>.discover_bucket_region— callsGetBucketLocation, normalises the response including the AWS quirks (None/ empty →us-east-1,EU→eu-west-1).ObjectEntry— unified entry for both objects and virtual folders.ListPage— one page ofListObjectsV2results, cursor-ready.list_objects— hierarchical listing (delimiter="/") with pagination.list_objects_flat— flat listing (no delimiter) with pagination.list_objects_parallel_pages— sequential pre-fetch of up to N pages starting from an optional initial cursor.
§OCP
BucketSummary and ListPage are additive IPC shapes — extra fields
(e.g. versions, tags) can be added without breaking existing call sites.
is_prefix unifies the entry list so the frontend handles one array, not two.
Parallel-page fetching is a separate function; callers opt in explicitly.
§Parallel pagination design note
AWS ListObjectsV2 continuation tokens are sequential — each token is
derived from the last key of the previous page, so true parallel pagination
is not possible without guessing split points. The list_objects_parallel_pages
function implements sequential pre-fetch: it fetches the first page, then
continues through up to max_pages pages in a tight loop. This is simpler
and correct; adding alphabet-based split parallelism is a future optimisation.
Structs§
- Bucket
Summary - Lightweight bucket view returned over the Tauri IPC boundary.
- List
Page - One page of
ListObjectsV2results. - Object
Entry - A single item returned by
ListObjectsV2.
Functions§
- classify_
sdk_ 🔒error - Map an S3 SDK error into the appropriate
AppErrorvariant. - discover_
bucket_ region - Discover the AWS region of
bucketby callingGetBucketLocation. - list_
buckets - Call
ListBucketsand map the response toVec<BucketSummary>. - list_
objects - List objects under
prefixinbucketusingdelimiter="/". - list_
objects_ flat - List objects under
prefixinbucketwithout a delimiter. - list_
objects_ parallel_ pages - Fetch up to
max_pagespages of hierarchical object listing starting at the givenprefix. - normalise_
region 🔒 - Normalise an S3
LocationConstraintstring to a canonical AWS region name.