Skip to main content

Module object

Module object 

Source
Expand description

Server-side copy, move, single-object delete, batch delete, and folder creation.

§Responsibilities

§OCP

  • CopyOptions is open for new directives (checksum, version preservation) via #[serde(default)] fields — existing callers are unaffected.
  • CopyOutcome is open for new variants (AsyncTransferQueued, …) — the discriminator pattern keeps the frontend adaptable.
  • move_object = copy_object + delete_single_object keeps the primitive surface minimal; task-36 (metadata setters) composes on the same primitives.
  • DeleteReport shape lets the frontend show “N deleted, M failed” without all-or-nothing semantics. AC-4 partial-failure contract.
  • Error classification mirrors list.rs patterns so the frontend maps AppError.kind uniformly.

Structs§

BytesPayload
Raw bytes fetched from S3, base64-encoded for safe IPC transport.
CopyObjectResultDetail
ETag + last-modified from the CopyObjectResult response element.
CopyOptions
Options that control the CopyObject API call.
CopyResult
IPC-safe result returned from copy_object and forwarded to the frontend.
DeleteFailure
One entry that failed to delete in a delete_objects_batch call.
DeleteReport
Result of delete_objects_batch.
DeletedObject
One entry that was successfully deleted in a delete_objects_batch call.
MoveResult
IPC-safe result returned from move_object.
TextPayload
Text content fetched from S3, decoded as UTF-8.

Enums§

CopyOutcome
Result of copy_object_with_fallback.
MetadataDirective
Metadata/tagging directive for CopyObject.

Constants§

DEFAULT_BYTES_MAX_BYTES
Default maximum bytes to read for binary preview.
DEFAULT_TEXT_MAX_BYTES
Default maximum bytes to read for text preview.
DELETE_BATCH_SIZE 🔒
Maximum number of keys per DeleteObjects API call (AWS hard limit).

Functions§

classify_copy_sdk_error 🔒
classify_delete_objects_sdk_error 🔒
classify_delete_sdk_error 🔒
classify_get_sdk_error 🔒
classify_head_sdk_error 🔒
classify_put_sdk_error 🔒
copy_object
Copy src_bucket/src_key to dest_bucket/dest_key via server-side copy.
copy_object_with_fallback
Copy src_bucket/src_key to dest_bucket/dest_key with a cross-account fallback.
create_folder
Create a virtual folder placeholder at bucket/prefix/.
delete_objects_batch
Delete a batch of objects from bucket.
delete_single_object
Delete a single object from bucket at key.
get_object_bytes
Fetch the first max_bytes bytes of bucket/key as base64-encoded binary.
get_object_text
Fetch the first max_bytes bytes of bucket/key as a UTF-8 string.
is_access_denied 🔒
Detect whether an AppError represents an access-denied condition from S3.
move_object
Move src_bucket/src_key to dest_bucket/dest_key.
parent_prefix
Return the parent prefix of an S3 key.
put_object_text
Write body to bucket/key with an optional ETag precondition.
set_object_storage_class
Change the storage class of bucket/key via a server-side self-copy.
tracing_or_eprintln 🔒
Emit a structured warning without pulling in the full tracing dependency. Replace with tracing::warn! once that crate is wired up.