pub struct Metadata {
pub is_redirect_tombstone: Option<bool>,
pub expiration_policy: ExpirationPolicy,
pub time_created: Option<SystemTime>,
pub time_expires: Option<SystemTime>,
pub content_type: Cow<'static, str>,
pub compression: Option<Compression>,
pub origin: Option<String>,
pub size: Option<usize>,
pub custom: BTreeMap<String, String>,
}Expand description
Per-object metadata.
Includes first-class fields (expiration, compression, timestamps, etc.) and arbitrary user-provided key-value metadata. See the module-level documentation for the HTTP header mapping conventions.
Fields§
§is_redirect_tombstone: Option<bool>Internal redirect tombstone marker (header: x-sn-redirect-tombstone).
When Some(true), this object is a tombstone stored on the high-volume
backend indicating that the real payload lives on the long-term backend.
This field is not included in from_headers
or to_headers — backends handle it directly.
Important: This field must remain the first field in the struct.
The BigTable backend uses a regex predicate on the serialized JSON that
assumes is_redirect_tombstone appears at the start of the object.
expiration_policy: ExpirationPolicyThe expiration policy of the object (header: x-sn-expiration).
Skipped during serialization when set to ExpirationPolicy::Manual.
time_created: Option<SystemTime>The creation/last replacement time of the object (header: x-sn-time-created).
Set by the server every time an object is put, i.e. when objects are first created and when existing objects are overwritten.
time_expires: Option<SystemTime>The resolved expiration timestamp (header: x-sn-time-expires).
Derived from the expiration_policy. When using
a time-to-idle policy, this reflects the expiration timestamp present
prior to the current access to the object.
content_type: Cow<'static, str>IANA media type of the object (header: Content-Type).
Defaults to DEFAULT_CONTENT_TYPE (application/octet-stream).
compression: Option<Compression>The compression algorithm used for this object (header: Content-Encoding).
origin: Option<String>The origin of the object (header: x-sn-origin).
Typically the IP address of the original source. This is an optional but encouraged field that tracks where the payload was originally obtained from (e.g. the IP of a Sentry SDK or CLI).
size: Option<usize>Size of the data in bytes, if known.
Not transmitted via HTTP headers; set by backends when the object is stored or retrieved.
custom: BTreeMap<String, String>Arbitrary user-provided key-value metadata (header prefix: x-snme-).
Each entry is transmitted as x-snme-{key}: {value}.
Implementations§
Source§impl Metadata
impl Metadata
Sourcepub fn from_headers(headers: &HeaderMap, prefix: &str) -> Result<Self, Error>
pub fn from_headers(headers: &HeaderMap, prefix: &str) -> Result<Self, Error>
Extracts public API metadata from the given HeaderMap.
A prefix can be also be provided which is being stripped from custom non-standard headers.
Internal fields like is_redirect_tombstone are not parsed; backends handle those
separately.
Sourcepub fn to_headers(&self, prefix: &str) -> Result<HeaderMap, Error>
pub fn to_headers(&self, prefix: &str) -> Result<HeaderMap, Error>
Turns the metadata into a HeaderMap for the public API.
It will prefix any non-standard headers with the given prefix.
Internal fields like is_redirect_tombstone and GCS-specific headers are not
emitted; backends handle those separately.
Sourcepub fn is_tombstone(&self) -> bool
pub fn is_tombstone(&self) -> bool
Returns true if this metadata represents a redirect tombstone.