Skip to main content

Module list

Module list 

Source
Expand description

Bucket and object listing helpers, plus region discovery.

§Responsibilities

  • BucketSummary — IPC-safe view returned to the frontend.
  • list_buckets — wraps ListBuckets, maps to Vec<BucketSummary>.
  • discover_bucket_region — calls GetBucketLocation, normalises the response including the AWS quirks (None / empty → us-east-1, EUeu-west-1).
  • ObjectEntry — unified entry for both objects and virtual folders.
  • ListPage — one page of ListObjectsV2 results, 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§

BucketSummary
Lightweight bucket view returned over the Tauri IPC boundary.
ListPage
One page of ListObjectsV2 results.
ObjectEntry
A single item returned by ListObjectsV2.

Functions§

classify_sdk_error 🔒
Map an S3 SDK error into the appropriate AppError variant.
discover_bucket_region
Discover the AWS region of bucket by calling GetBucketLocation.
list_buckets
Call ListBuckets and map the response to Vec<BucketSummary>.
list_objects
List objects under prefix in bucket using delimiter="/".
list_objects_flat
List objects under prefix in bucket without a delimiter.
list_objects_parallel_pages
Fetch up to max_pages pages of hierarchical object listing starting at the given prefix.
normalise_region 🔒
Normalise an S3 LocationConstraint string to a canonical AWS region name.