pub struct ObjectConfig {
pub endpoint: String,
pub private_key: String,
pub public_key: String,
pub region: String,
pub proxy_suffix: Option<String>,
pub custom_host: Option<String>,
pub protocol: UfileProtocol,
}Expand description
Re-export configuration for s3 credential Configuration for Ucloud object operations. This struct holds the necessary information such as region, proxy suffix, and custom host to interact with Ucloud object storage.
Fields§
§endpoint: Stringdefault http request endpoint.
private_key: Stringprivate key
public_key: Stringpublic key
region: String仓库地区 (eg: ‘cn-bj’)
proxy_suffix: Option<String>代理后缀 (eg: ‘ufileos.com’)
custom_host: Option<String>自定义域名 (eg: ‘api.ucloud.cn’):若配置了非空自定义域名,则使用自定义域名,不会使用 region + proxySuffix 拼接
protocol: UfileProtocolprotocol
Implementations§
Source§impl ObjectConfig
impl ObjectConfig
Sourcepub fn generate_final_host(&self, bucket_name: &str, key_name: &str) -> String
pub fn generate_final_host(&self, bucket_name: &str, key_name: &str) -> String
A method to generate the final request full hosts.
This method is used to generate private url which contains signature and expire time.
§Arguments
method- The http method.bucket_name- The name of the bucket.key_name- The name of the object.expires- The expire time of the url. unit: second.
Trait Implementations§
Source§impl Clone for ObjectConfig
impl Clone for ObjectConfig
Source§fn clone(&self) -> ObjectConfig
fn clone(&self) -> ObjectConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ObjectConfig
impl Debug for ObjectConfig
Source§impl Default for ObjectConfig
impl Default for ObjectConfig
Source§impl<'de> Deserialize<'de> for ObjectConfig
impl<'de> Deserialize<'de> for ObjectConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ObjectConfig
impl RefUnwindSafe for ObjectConfig
impl Send for ObjectConfig
impl Sync for ObjectConfig
impl Unpin for ObjectConfig
impl UnsafeUnpin for ObjectConfig
impl UnwindSafe for ObjectConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more