pub struct B2SimpleClient { /* private fields */ }Implementations§
Source§impl B2SimpleClient
impl B2SimpleClient
pub async fn new<S: AsRef<str>, K: AsRef<str>>( key_id: S, application_key: K, ) -> Result<B2SimpleClient, B2Error>
pub fn auth_data(&self) -> B2AuthData
Sourcepub async fn cancel_large_file(
&self,
file_id: String,
) -> Result<B2CancelLargeFileResponse, B2Error>
pub async fn cancel_large_file( &self, file_id: String, ) -> Result<B2CancelLargeFileResponse, B2Error>
Sourcepub async fn copy_part(
&self,
request_body: B2CopyPartBody,
) -> Result<B2FilePart, B2Error>
pub async fn copy_part( &self, request_body: B2CopyPartBody, ) -> Result<B2FilePart, B2Error>
Sourcepub async fn create_bucket(
&self,
body: B2CreateBucketBody,
) -> Result<B2Bucket, B2Error>
pub async fn create_bucket( &self, body: B2CreateBucketBody, ) -> Result<B2Bucket, B2Error>
Sourcepub async fn create_key(
&self,
request_body: B2CreateKeyBody,
) -> Result<B2AppKey, B2Error>
pub async fn create_key( &self, request_body: B2CreateKeyBody, ) -> Result<B2AppKey, B2Error>
Sourcepub async fn delete_bucket(
&self,
account_id: String,
bucket_id: String,
) -> Result<B2Bucket, B2Error>
pub async fn delete_bucket( &self, account_id: String, bucket_id: String, ) -> Result<B2Bucket, B2Error>
Sourcepub async fn delete_file_version(
&self,
request_body: B2DeleteFileVersionBody,
) -> Result<B2DeleteFileVersionResponse, B2Error>
pub async fn delete_file_version( &self, request_body: B2DeleteFileVersionBody, ) -> Result<B2DeleteFileVersionResponse, B2Error>
Sourcepub async fn download_file_by_id(
&self,
file_id: String,
request_query_params: Option<B2DownloadFileQueryParameters>,
) -> Result<B2DownloadFileContent, B2Error>
pub async fn download_file_by_id( &self, file_id: String, request_query_params: Option<B2DownloadFileQueryParameters>, ) -> Result<B2DownloadFileContent, B2Error>
Sourcepub async fn download_file_by_name(
&self,
bucket_name: String,
file_name: String,
request_query_params: Option<B2DownloadFileQueryParameters>,
) -> Result<B2DownloadFileContent, B2Error>
pub async fn download_file_by_name( &self, bucket_name: String, file_name: String, request_query_params: Option<B2DownloadFileQueryParameters>, ) -> Result<B2DownloadFileContent, B2Error>
Sourcepub async fn finish_large_file(
&self,
request_body: B2FinishLargeFileBody,
) -> Result<B2File, B2Error>
pub async fn finish_large_file( &self, request_body: B2FinishLargeFileBody, ) -> Result<B2File, B2Error>
Sourcepub async fn get_bucket_notification_rules(
&self,
bucket_id: String,
) -> Result<B2BucketNotificationRulesResponseBody, B2Error>
pub async fn get_bucket_notification_rules( &self, bucket_id: String, ) -> Result<B2BucketNotificationRulesResponseBody, B2Error>
Sourcepub async fn get_upload_part_url(
&self,
file_id: String,
) -> Result<B2GetUploadPartUrlResponse, B2Error>
pub async fn get_upload_part_url( &self, file_id: String, ) -> Result<B2GetUploadPartUrlResponse, B2Error>
Sourcepub async fn get_upload_url(
&self,
bucket_id: String,
) -> Result<B2GetUploadUrlResponse, B2Error>
pub async fn get_upload_url( &self, bucket_id: String, ) -> Result<B2GetUploadUrlResponse, B2Error>
Sourcepub async fn hide_file(
&self,
bucket_id: String,
file_name: String,
) -> Result<B2File, B2Error>
pub async fn hide_file( &self, bucket_id: String, file_name: String, ) -> Result<B2File, B2Error>
Sourcepub async fn list_buckets(
&self,
request_body: B2ListBucketsBody,
) -> Result<B2ListBucketsResponse, B2Error>
pub async fn list_buckets( &self, request_body: B2ListBucketsBody, ) -> Result<B2ListBucketsResponse, B2Error>
Sourcepub async fn list_file_names(
&self,
request_body: B2ListFileNamesQueryParameters,
) -> Result<B2ListFilesResponse, B2Error>
pub async fn list_file_names( &self, request_body: B2ListFileNamesQueryParameters, ) -> Result<B2ListFilesResponse, B2Error>
Sourcepub async fn list_file_versions(
&self,
request_body: B2ListFileVersionsQueryParameters,
) -> Result<B2ListFileVersionsResponse, B2Error>
pub async fn list_file_versions( &self, request_body: B2ListFileVersionsQueryParameters, ) -> Result<B2ListFileVersionsResponse, B2Error>
Sourcepub async fn list_keys(
&self,
request_body: B2ListKeysParameters,
) -> Result<B2ListKeysResponse, B2Error>
pub async fn list_keys( &self, request_body: B2ListKeysParameters, ) -> Result<B2ListKeysResponse, B2Error>
Sourcepub async fn list_parts(
&self,
request_body: B2ListPartsQueryParameters,
) -> Result<B2ListPartsResponse, B2Error>
pub async fn list_parts( &self, request_body: B2ListPartsQueryParameters, ) -> Result<B2ListPartsResponse, B2Error>
Sourcepub async fn list_unfinished_large_files(
&self,
request_body: B2ListUnfinishedLargeFilesQueryParameters,
) -> Result<B2ListUnfinishedLargeFilesResponse, B2Error>
pub async fn list_unfinished_large_files( &self, request_body: B2ListUnfinishedLargeFilesQueryParameters, ) -> Result<B2ListUnfinishedLargeFilesResponse, B2Error>
Sourcepub async fn set_bucket_notification_rules(
&self,
request_body: B2BucketNotificationRulesResponseBody,
) -> Result<B2BucketNotificationRulesResponseBody, B2Error>
pub async fn set_bucket_notification_rules( &self, request_body: B2BucketNotificationRulesResponseBody, ) -> Result<B2BucketNotificationRulesResponseBody, B2Error>
Sourcepub async fn start_large_file(
&self,
request_body: B2StartLargeFileUploadBody,
) -> Result<B2File, B2Error>
pub async fn start_large_file( &self, request_body: B2StartLargeFileUploadBody, ) -> Result<B2File, B2Error>
Sourcepub async fn update_bucket(
&self,
request_body: B2UpdateBucketBody,
) -> Result<B2Bucket, B2Error>
pub async fn update_bucket( &self, request_body: B2UpdateBucketBody, ) -> Result<B2Bucket, B2Error>
Sourcepub async fn update_file_legal_hold(
&self,
request_body: B2UpdateFileLegalHoldBodyResponse,
) -> Result<B2UpdateFileLegalHoldBodyResponse, B2Error>
pub async fn update_file_legal_hold( &self, request_body: B2UpdateFileLegalHoldBodyResponse, ) -> Result<B2UpdateFileLegalHoldBodyResponse, B2Error>
Sourcepub async fn update_file_retention(
&self,
request_body: B2UpdateFileRetentionBody,
) -> Result<B2UpdateFileRetentionResponse, B2Error>
pub async fn update_file_retention( &self, request_body: B2UpdateFileRetentionBody, ) -> Result<B2UpdateFileRetentionResponse, B2Error>
Sourcepub 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>
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>
Sourcepub async fn upload_part<F: Into<Body>>(
&self,
request_headers: B2UploadPartHeaders,
part: F,
upload_url: String,
) -> Result<B2FilePart, B2Error>
pub async fn upload_part<F: Into<Body>>( &self, request_headers: B2UploadPartHeaders, part: F, upload_url: String, ) -> Result<B2FilePart, B2Error>
pub fn has_capability(&self, capability: &B2KeyCapability) -> bool
pub fn has_capabilities( &self, capabilities: &[B2KeyCapability], ) -> Result<(), B2Error>
Trait Implementations§
Source§impl Clone for B2SimpleClient
impl Clone for B2SimpleClient
Source§fn clone(&self) -> B2SimpleClient
fn clone(&self) -> B2SimpleClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for B2SimpleClient
impl !RefUnwindSafe for B2SimpleClient
impl Send for B2SimpleClient
impl Sync for B2SimpleClient
impl Unpin for B2SimpleClient
impl !UnwindSafe for B2SimpleClient
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