Struct 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) -> Self
where S: Into<Cow<'a, str>>,

Source

pub fn new_with_opts<S>( key_id: S, key_secret: S, endpoint: S, bucket: S, opts: Options, ) -> Self
where 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>>) -> String
where S: AsRef<str>,

Source

pub fn get_params_str<S>(&self, params: &HashMap<S, Option<S>>) -> String
where 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), OSSError>
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> Auth for OSS<'a>

Source§

fn oss_sign( &self, verb: &str, bucket: &str, object: &str, oss_resources: &str, headers: &HeaderMap, ) -> Result<String, OSSError>

Source§

fn sign_content(&self, content: &str) -> Result<String, OSSError>

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<'life0, 'async_trait, S, H, R>( &'life0 self, headers: H, resources: R, ) -> Pin<Box<dyn Future<Output = Result<ListBucketResult, OSSError>> + 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 list_object_v2<'life0, 'async_trait, S>( &'life0 self, prefix: Option<S>, delimiter: Option<S>, ) -> Pin<Box<dyn Future<Output = Result<ListBucketResult, OSSError>> + Send + 'async_trait>>
where S: AsRef<str> + 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, OSSError>> + 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 append_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<Option<u64>, OSSError>> + 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 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<(), OSSError>> + 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<(), OSSError>> + 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<(), OSSError>> + 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, OSSError>> + Send + 'async_trait>>
where S: AsRef<str> + Send + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

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, OSSError>> + 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,

Auto Trait Implementations§

§

impl<'a> Freeze for OSS<'a>

§

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 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> 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> ErasedDestructor for T
where T: 'static,