Skip to main content

ObjectMetadata

Struct ObjectMetadata 

Source
pub struct ObjectMetadata {
Show 25 fields pub request_id: String, pub content_length: u64, pub etag: String, pub hash_crc64ecma: Option<u64>, pub transition_time: Option<String>, pub last_access_time: Option<String>, pub last_modified: Option<String>, pub version_id: Option<String>, pub server_side_encryption: Option<ServerSideEncryptionAlgorithm>, pub server_side_encryption_key_id: Option<String>, pub storage_class: Option<StorageClass>, pub object_type: Option<ObjectType>, pub next_append_position: Option<u64>, pub expiration: Option<String>, pub restore: Option<String>, pub process_status: Option<String>, pub request_charged: Option<String>, pub content_md5: Option<String>, pub access_control_allow_origin: Option<String>, pub access_control_allow_methods: Option<String>, pub access_control_allow_max_age: Option<String>, pub access_control_allow_headers: Option<String>, pub access_control_expose_headers: Option<String>, pub tag_count: Option<u32>, pub metadata: HashMap<String, String>,
}

Fields§

§request_id: String§content_length: u64§etag: String

已经移除了首尾双引号(")之后的字符串

§hash_crc64ecma: Option<u64>§transition_time: Option<String>

Object 通过生命周期规则转储为冷归档或者深度冷归档存储类型的时间。

§last_access_time: Option<String>

Object 的最后一次访问时间。时间格式为 HTTP 1.1 协议中规定的 GMT 时间。 开启访问跟踪时,该字段的值会随着文件被访问的时间持续更新。 如果开启后关闭了访问跟踪,该字段的值保留为上一次最后更新的值。 示例: Tue, 30 Mar 2021 06:07:48 GMT

§last_modified: Option<String>

时间格式为 HTTP 1.1 协议中规定的 GMT 时间。

§version_id: Option<String>§server_side_encryption: Option<ServerSideEncryptionAlgorithm>§server_side_encryption_key_id: Option<String>§storage_class: Option<StorageClass>§object_type: Option<ObjectType>§next_append_position: Option<u64>

对于 Appendable 类型的 Object 会返回此 Header,指明下一次请求应当提供的 position

§expiration: Option<String>

配置了生命周期规则的Bucket中Object的过期时间。

§restore: Option<String>

如果 Object 存储类型为 ArchiveColdArchive 或者 DeepColdArchive, 且您已提交 Restore 请求,则响应头中会以 x-oss-restore 返回该 Object 的 Restore 状态,分如下几种情况:

  • 如果没有提交 Restore 或者 Restore 已经超时,则不返回该字段。
  • 如果已经提交 Restore,且 Restore 没有完成,则返回的 x-oss-restore 值为 ongoing-request="true"
  • 如果已经提交 Restore,且 Restore 已经完成,则返回的 x-oss-restore 值为 ongoing-request="false", expiry-date="Sun, 16 Apr 2017 08:12:33 GMT",其中 expiry-date 是 Restore 完成后 Object 进入可读状态的过期时间。
§process_status: Option<String>

当用户通过轻量消息队列 SMQ 创建 OSS 事件通知后, 在进行请求 OSS 相关操作时如果有匹配的事件通知规则, 则响应中会携带这个 Header,值为经过 Base64 编码 JSON 格式的事件通知结果。

§request_charged: Option<String>

当 Object 所属的 Bucket 被设置为请求者付费模式, 且请求者不是 Bucket 的拥有者时,响应中将携带此 Header,值为 requester

§content_md5: Option<String>
  • 对于 Normal 类型的 Object,根据 RFC 1864 标准对消息内容(不包括Header)计算 Md5 值获得 128 比特位数字,对该数字进行 Base64 编码作为一个消息的 Content-Md5 值。
  • MultipartAppendable 类型的文件不会返回这个 Header。
§access_control_allow_origin: Option<String>

当 Object 所在的 Bucket 配置了 CORS 规则,且请求的 Origin 满足指定的 CORS 规则时会在响应中包含这个 Origin。

§access_control_allow_methods: Option<String>

当 Object 所在的 Bucket 配置了 CORS 规则,且请求的 Access-Control-Request-Method 满足指定的CORS规则时会在响应中包含允许的 Methods。

§access_control_allow_max_age: Option<String>

当 Object 所在的 Bucket 配置了 CORS 规则,且请求满足 Bucket 配置的 CORS 规则时会在响应中包含 MaxAgeSeconds

§access_control_allow_headers: Option<String>

当 Object 所在的 Bucket 配置了 CORS 规则,且请求满足指定的 CORS 规则时会在响应中包含这些 Headers。

§access_control_expose_headers: Option<String>

表示允许访问客户端 JavaScript 程序的 headers 列表。当 Object 所在的 Bucket 配置了 CORS 规则,且请求满足指定的CORS规则时会在响应中包含 ExposeHeader。

§tag_count: Option<u32>

对象关联的标签个数。仅当用户有读取标签权限时返回。

§metadata: HashMap<String, String>

x-oss-meta- 开头的用户自定义属性

Trait Implementations§

Source§

impl Clone for ObjectMetadata

Source§

fn clone(&self) -> ObjectMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObjectMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ObjectMetadata

Source§

fn default() -> ObjectMetadata

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ObjectMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<HashMap<String, String>> for ObjectMetadata

Source§

fn from(headers: HashMap<String, String>) -> Self

Consumes the headers map and return ObjectMetadata

Source§

impl Serialize for ObjectMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,