azure_storage_blobs/options/
blob_cache_control.rs1use azure_core::headers::{self, Header};
2
3#[derive(Clone, Debug, PartialEq, Eq)]
4pub struct BlobCacheControl(std::borrow::Cow<'static, str>);
5
6impl BlobCacheControl {
7 pub const fn from_static(s: &'static str) -> Self {
8 Self(std::borrow::Cow::Borrowed(s))
9 }
10
11 pub fn as_str(&self) -> &str {
12 self.0.as_ref()
13 }
14}
15
16impl From<&'static str> for BlobCacheControl {
17 fn from(s: &'static str) -> Self {
18 Self::from_static(s)
19 }
20}
21
22impl From<String> for BlobCacheControl {
23 fn from(s: String) -> Self {
24 Self(std::borrow::Cow::Owned(s))
25 }
26}
27
28impl From<&String> for BlobCacheControl {
29 fn from(s: &String) -> Self {
30 Self(std::borrow::Cow::Owned(s.clone()))
31 }
32}
33
34impl Header for BlobCacheControl {
35 fn name(&self) -> headers::HeaderName {
36 azure_core::headers::BLOB_CACHE_CONTROL
37 }
38
39 fn value(&self) -> headers::HeaderValue {
40 self.0.to_string().into()
41 }
42}