[][src]Struct oss::OSSClient

pub struct OSSClient { /* fields omitted */ }

OSSClient - Alibaba Cloud OSS Client

Reference URL: https://help.aliyun.com/document_detail/31952.html

let oss_client = OSSClient::new("AK", "SK");

Implementations

impl OSSClient[src]

OSS Client implemention

pub fn new(
    endpoint: &str,
    access_key_id: &str,
    access_key_secret: &str
) -> OSSClient
[src]

New OSSClient

Use access_key_id and access_key_secret to create a OSSClient Consider support STS!

pub fn from_file(f: &str) -> XResult<Self>[src]

New OSSClient from JSON file

pub fn from_json(json: &str) -> XResult<Self>[src]

New OSSClient from JSON

JSON sample:

{
    "endpoint": "",
    "accessKeyId": "",
    "accessKeySecret": ""
}

pub async fn put_file<'_, '_, '_>(
    &'_ self,
    bucket_name: &'_ str,
    key: &'_ str,
    expire_in_seconds: u64,
    file: File
) -> XResult<Response>
[src]

Put file will read full file content to memory and send with HTTP protocol

pub async fn delete_file<'_, '_, '_>(
    &'_ self,
    bucket_name: &'_ str,
    key: &'_ str
) -> XResult<Response>
[src]

pub async fn get_file_content<'_, '_, '_>(
    &'_ self,
    bucket_name: &'_ str,
    key: &'_ str
) -> XResult<Option<String>>
[src]

pub async fn get_file_content_bytes<'_, '_, '_>(
    &'_ self,
    bucket_name: &'_ str,
    key: &'_ str
) -> XResult<Option<Vec<u8>>>
[src]

pub async fn put_file_content<'_, '_, '_, '_>(
    &'_ self,
    bucket_name: &'_ str,
    key: &'_ str,
    content: &'_ str
) -> XResult<Response>
[src]

pub async fn put_file_content_bytes<'_, '_, '_>(
    &'_ self,
    bucket_name: &'_ str,
    key: &'_ str,
    content_bytes: Vec<u8>
) -> XResult<Response>
[src]

pub fn generate_signed_put_url(
    &self,
    bucket_name: &str,
    key: &str,
    expire_in_seconds: u64
) -> String
[src]

pub fn generate_signed_get_url(
    &self,
    bucket_name: &str,
    key: &str,
    expire_in_seconds: u64
) -> String
[src]

pub fn generate_signed_delete_url(
    &self,
    bucket_name: &str,
    key: &str,
    expire_in_seconds: u64
) -> String
[src]

pub fn generate_signed_url(
    &self,
    verb: &str,
    bucket_name: &str,
    key: &str,
    expire_in_seconds: u64,
    is_https: bool
) -> String
[src]

Trait Implementations

impl Clone for OSSClient[src]

impl Debug for OSSClient[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.