Module Awskit_s3.MetadataSource

User metadata represented as unprefixed x-amz-meta-* key/value pairs.

Sourcetype t

Opaque validated metadata collection.

Keys are supplied without the x-amz-meta- prefix. The S3 request layer adds the prefix when emitting headers and strips it when parsing response metadata. Duplicate keys are rejected case-insensitively.

Sourcetype entry = {
  1. key : string;
  2. value : Header_value.t;
}

One validated metadata entry.

Sourceval empty : t

Empty metadata collection.

Sourceval of_list : (string * string) list -> (t, Awskit.Error.t) result

Validate metadata entries and preserve their insertion order. The aggregate byte length of unprefixed keys and values must fit S3's 2 KiB user-metadata limit.

Sourceval of_list_exn : (string * string) list -> t

Like of_list, but raises Awskit.Error.Awskit_error carrying the structured validation error on validation failure.

Sourceval to_list : t -> (string * string) list

Return raw unprefixed key/value pairs in insertion order.

Sourceval entries : t -> entry list

Return typed metadata entries in insertion order.

Sourceval add : key:string -> value:string -> t -> (t, Awskit.Error.t) result

Add one metadata entry at the end of the collection, rejecting invalid or duplicate keys and collections above S3's 2 KiB user-metadata limit.

Sourceval pp : Format.formatter -> t -> unit

Pretty-print metadata as raw key/value pairs.

Sourceval equal : t -> t -> bool

Compare two metadata collections in insertion order.

Equality is order-sensitive. Keys compare by their exact unprefixed string spelling and values compare by their exact header value spelling.