B2SimpleClient

Struct B2SimpleClient 

Source
pub struct B2SimpleClient { /* private fields */ }

Implementations§

Source§

impl B2SimpleClient

Source

pub async fn new<S: AsRef<str>, K: AsRef<str>>( key_id: S, application_key: K, ) -> Result<B2SimpleClient, B2Error>

Source

pub fn auth_data(&self) -> B2AuthData

Source

pub async fn authorize_account<S: AsRef<str>, K: AsRef<str>>( &self, key_id: S, application_key: K, ) -> Result<B2AuthData, B2Error>

Source

pub async fn cancel_large_file( &self, file_id: String, ) -> Result<B2CancelLargeFileResponse, B2Error>

Source

pub async fn copy_file(&self, body: B2CopyFileBody) -> Result<B2File, B2Error>

Source

pub async fn copy_part( &self, request_body: B2CopyPartBody, ) -> Result<B2FilePart, B2Error>

Source

pub async fn create_bucket( &self, body: B2CreateBucketBody, ) -> Result<B2Bucket, B2Error>

Source

pub async fn create_key( &self, request_body: B2CreateKeyBody, ) -> Result<B2AppKey, B2Error>

Source

pub async fn delete_bucket( &self, account_id: String, bucket_id: String, ) -> Result<B2Bucket, B2Error>

Source

pub async fn delete_file_version( &self, request_body: B2DeleteFileVersionBody, ) -> Result<B2DeleteFileVersionResponse, B2Error>

Source

pub async fn delete_key( &self, application_key_id: String, ) -> Result<B2AppKey, B2Error>

Source

pub async fn download_file_by_id( &self, file_id: String, request_query_params: Option<B2DownloadFileQueryParameters>, ) -> Result<B2DownloadFileContent, B2Error>

Source

pub async fn download_file_by_name( &self, bucket_name: String, file_name: String, request_query_params: Option<B2DownloadFileQueryParameters>, ) -> Result<B2DownloadFileContent, B2Error>

Source

pub async fn finish_large_file( &self, request_body: B2FinishLargeFileBody, ) -> Result<B2File, B2Error>

Source

pub async fn get_bucket_notification_rules( &self, bucket_id: String, ) -> Result<B2BucketNotificationRulesResponseBody, B2Error>

Source

pub async fn get_download_authorization( &self, request_body: B2GetDownloadAuthorizationBody, ) -> Result<B2GetDownloadAuthorizationBodyResponse, B2Error>

Source

pub async fn get_file_info(&self, file_id: String) -> Result<B2File, B2Error>

Source

pub async fn get_upload_part_url( &self, file_id: String, ) -> Result<B2GetUploadPartUrlResponse, B2Error>

Source

pub async fn get_upload_url( &self, bucket_id: String, ) -> Result<B2GetUploadUrlResponse, B2Error>

Source

pub async fn hide_file( &self, bucket_id: String, file_name: String, ) -> Result<B2File, B2Error>

Source

pub async fn list_buckets( &self, request_body: B2ListBucketsBody, ) -> Result<B2ListBucketsResponse, B2Error>

Source

pub async fn list_file_names( &self, request_body: B2ListFileNamesQueryParameters, ) -> Result<B2ListFilesResponse, B2Error>

Source

pub async fn list_file_versions( &self, request_body: B2ListFileVersionsQueryParameters, ) -> Result<B2ListFileVersionsResponse, B2Error>

Source

pub async fn list_keys( &self, request_body: B2ListKeysParameters, ) -> Result<B2ListKeysResponse, B2Error>

Source

pub async fn list_parts( &self, request_body: B2ListPartsQueryParameters, ) -> Result<B2ListPartsResponse, B2Error>

Source

pub async fn list_unfinished_large_files( &self, request_body: B2ListUnfinishedLargeFilesQueryParameters, ) -> Result<B2ListUnfinishedLargeFilesResponse, B2Error>

Source

pub async fn set_bucket_notification_rules( &self, request_body: B2BucketNotificationRulesResponseBody, ) -> Result<B2BucketNotificationRulesResponseBody, B2Error>

Source

pub async fn start_large_file( &self, request_body: B2StartLargeFileUploadBody, ) -> Result<B2File, B2Error>

Source

pub async fn update_bucket( &self, request_body: B2UpdateBucketBody, ) -> Result<B2Bucket, B2Error>

Source

pub async fn update_file_retention( &self, request_body: B2UpdateFileRetentionBody, ) -> Result<B2UpdateFileRetentionResponse, B2Error>

Source

pub async fn upload_file<S: AsRef<str>, F: Into<Body>>( &self, file: F, upload_url: S, request_headers: B2UploadFileHeaders, file_info: Option<HashMap<S, impl AsRef<str>>>, ) -> Result<B2File, B2Error>

Source

pub async fn upload_part<F: Into<Body>>( &self, request_headers: B2UploadPartHeaders, part: F, upload_url: String, ) -> Result<B2FilePart, B2Error>

Source

pub fn get_authorization_token(&self) -> &str

Source

pub fn has_capability(&self, capability: &B2KeyCapability) -> bool

Source

pub fn has_capabilities( &self, capabilities: &[B2KeyCapability], ) -> Result<(), B2Error>

Trait Implementations§

Source§

impl Clone for B2SimpleClient

Source§

fn clone(&self) -> B2SimpleClient

Returns a duplicate 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 Debug for B2SimpleClient

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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,