Struct oss_rust_sdk::oss::OSS

source ·
pub struct OSS<'a> { /* private fields */ }

Implementations§

source§

impl<'a> OSS<'a>

source

pub fn new<S>(key_id: S, key_secret: S, endpoint: S, bucket: S) -> Selfwhere S: Into<Cow<'a, str>>,

source

pub fn new_with_opts<S>( key_id: S, key_secret: S, endpoint: S, bucket: S, opts: Options ) -> Selfwhere S: Into<Cow<'a, str>>,

source

pub fn bucket(&self) -> &str

source

pub fn endpoint(&self) -> &str

source

pub fn key_id(&self) -> &str

source

pub fn key_secret(&self) -> &str

source

pub fn set_bucket(&mut self, bucket: &'a str)

source

pub fn host(&self, bucket: &str, object: &str, resources_str: &str) -> String

source

pub fn date(&self) -> String

source

pub fn get_resources_str<S>(&self, params: &HashMap<S, Option<S>>) -> Stringwhere S: AsRef<str>,

source

pub fn get_params_str<S>(&self, params: &HashMap<S, Option<S>>) -> Stringwhere S: AsRef<str>,

source

pub fn build_request<S1, S2, H, R>( &self, req_type: RequestType, object_name: S1, headers: H, resources: R ) -> Result<(String, HeaderMap), Error>where S1: AsRef<str>, S2: AsRef<str>, H: Into<Option<HashMap<S2, S2>>>, R: Into<Option<HashMap<S2, Option<S2>>>>,

Build a request. Return url and header for reqwest client builder.

Trait Implementations§

source§

impl<'a> AsyncObjectAPI for OSS<'a>

source§

fn list_object<'life0, 'async_trait, S, H, R>( &'life0 self, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<ListObjects, Error>> + Send + 'async_trait>>where S: AsRef<str> + 'async_trait, H: Into<Option<HashMap<S, S>>> + Send + 'async_trait, R: Into<Option<HashMap<S, Option<S>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

source§

fn get_object<'life0, 'async_trait, S1, S2, H, R>( &'life0 self, object_name: S1, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<Bytes, Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S2, S2>>> + Send + 'async_trait, R: Into<Option<HashMap<S2, Option<S2>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

source§

fn put_object<'life0, 'life1, 'async_trait, S1, S2, H, R>( &'life0 self, buf: &'life1 [u8], object_name: S1, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S2, S2>>> + Send + 'async_trait, R: Into<Option<HashMap<S2, Option<S2>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

fn copy_object_from_object<'life0, 'async_trait, S1, S2, S3, H, R>( &'life0 self, src: S1, dest: S2, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, S3: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S3, S3>>> + Send + 'async_trait, R: Into<Option<HashMap<S3, Option<S3>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

source§

fn delete_object<'life0, 'async_trait, S>( &'life0 self, object_name: S ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where S: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

source§

fn head_object<'life0, 'async_trait, S>( &'life0 self, object_name: S ) -> Pin<Box<dyn Future<Output = Result<ObjectMeta, Error>> + Send + 'async_trait>>where S: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

source§

fn init_multi<'life0, 'async_trait, S1, S2, H, R>( &'life0 self, object_name: S1, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<InitiateMultipartUploadResult, Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S2, S2>>> + Send + 'async_trait, R: Into<Option<HashMap<S2, Option<S2>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Notify oss to init a Multipart Upload event
source§

fn upload_part<'life0, 'life1, 'async_trait, S1, S2, H, R>( &'life0 self, buf: &'life1 [u8], object_name: S1, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<String, Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S2, S2>>> + Send + 'async_trait, R: Into<Option<HashMap<S2, Option<S2>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upload data in chunks according to the specified Object name and uploadId
source§

fn complete_multi<'life0, 'async_trait, S1, S2, H, R>( &'life0 self, body: String, object_name: S1, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<CompleteMultipartUploadResult, Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S2, S2>>> + Send + 'async_trait, R: Into<Option<HashMap<S2, Option<S2>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Complete the multipart upload of the entire file Read more
source§

fn abort_multi<'life0, 'async_trait, S1, S2, H, R>( &'life0 self, object_name: S1, headers: H, resources: R ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where S1: AsRef<str> + Send + 'async_trait, S2: AsRef<str> + Send + 'async_trait, H: Into<Option<HashMap<S2, S2>>> + Send + 'async_trait, R: Into<Option<HashMap<S2, Option<S2>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Cancel the MultipartUpload event and delete the corresponding Part data
source§

impl<'a> Clone for OSS<'a>

source§

fn clone(&self) -> OSS<'a>

Returns a copy 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<'a> Debug for OSS<'a>

source§

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

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

impl<'a> ObjectAPI for OSS<'a>

source§

fn list_object<S, H, R>( &self, headers: H, resources: R ) -> Result<ListObjects, Error>where S: AsRef<str>, H: Into<Option<HashMap<S, S>>>, R: Into<Option<HashMap<S, Option<S>>>>,

source§

fn get_object<S1, S2, H, R>( &self, object_name: S1, headers: H, resources: R ) -> Result<Vec<u8>, Error>where S1: AsRef<str>, S2: AsRef<str>, H: Into<Option<HashMap<S2, S2>>>, R: Into<Option<HashMap<S2, Option<S2>>>>,

source§

fn get_object_acl<S>(&self, object_name: S) -> Result<String, Error>where S: AsRef<str>,

source§

fn get_object_signed_url<S1>(&self, object_name: S1, expires: usize) -> Stringwhere S1: AsRef<str> + Send,

source§

fn put_object_from_file<S1, S2, S3, H, R>( &self, file: S1, object_name: S2, headers: H, resources: R ) -> Result<(), Error>where S1: AsRef<str>, S2: AsRef<str>, S3: AsRef<str>, H: Into<Option<HashMap<S3, S3>>>, R: Into<Option<HashMap<S3, Option<S3>>>>,

source§

fn put_object_from_buffer<S1, S2, H, R>( &self, buf: &[u8], object_name: S1, headers: H, resources: R ) -> Result<(), Error>where S1: AsRef<str>, S2: AsRef<str>, H: Into<Option<HashMap<S2, S2>>>, R: Into<Option<HashMap<S2, Option<S2>>>>,

source§

fn copy_object_from_object<S1, S2, S3, H, R>( &self, src: S1, object_name: S2, headers: H, resources: R ) -> Result<(), Error>where S1: AsRef<str>, S2: AsRef<str>, S3: AsRef<str>, H: Into<Option<HashMap<S3, S3>>>, R: Into<Option<HashMap<S3, Option<S3>>>>,

source§

fn delete_object<S>(&self, object_name: S) -> Result<(), Error>where S: AsRef<str>,

source§

impl<'a> ServiceAPI for OSS<'a>

source§

fn list_bucket<'life0, 'async_trait, S, R>( &'life0 self, resources: R ) -> Pin<Box<dyn Future<Output = Result<ListBuckets, Error>> + Send + 'async_trait>>where S: AsRef<str> + Send + 'async_trait, R: Into<Option<HashMap<S, Option<S>>>> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

source§

impl<'a> ServiceAPI for OSS<'a>

source§

fn list_bucket<S, R>(&self, resources: R) -> Result<ListBuckets, Error>where S: AsRef<str>, R: Into<Option<HashMap<S, Option<S>>>>,

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for OSS<'a>

§

impl<'a> Send for OSS<'a>

§

impl<'a> Sync for OSS<'a>

§

impl<'a> Unpin for OSS<'a>

§

impl<'a> !UnwindSafe for OSS<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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