pub struct B2Client { /* private fields */ }Implementations§
Source§impl B2Client
impl B2Client
pub async fn new( key_id: String, application_key: String, ) -> Result<Self, B2Error>
Sourcepub fn status(&self) -> B2ClientStatus
pub fn status(&self) -> B2ClientStatus
Gets current client status
Sourcepub fn basic_client(&self) -> Arc<B2SimpleClient>
pub fn basic_client(&self) -> Arc<B2SimpleClient>
Returns reference to inner basic client
Sourcepub async fn create_upload<T>(
&self,
file: T,
file_name: String,
bucket_id: String,
optional_info: Option<HashMap<String, String>>,
file_size: u64,
options: Option<FileUploadOptions>,
) -> Arc<FileUpload>where
T: AsyncFileReader + 'static,
pub async fn create_upload<T>(
&self,
file: T,
file_name: String,
bucket_id: String,
optional_info: Option<HashMap<String, String>>,
file_size: u64,
options: Option<FileUploadOptions>,
) -> Arc<FileUpload>where
T: AsyncFileReader + 'static,
Creates files upload tracker and returns reference to it.
Tracker doesn’t start upload automatically, it needs to be started manually.
Sourcepub async fn get_current_tracked_uploads(&self) -> Vec<Arc<FileUpload>>
pub async fn get_current_tracked_uploads(&self) -> Vec<Arc<FileUpload>>
Gets the list of current tracked upload tasks
Sourcepub async fn abort_upload(&self, upload_id: u64)
pub async fn abort_upload(&self, upload_id: u64)
Aborts a specific upload using its ID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for B2Client
impl !RefUnwindSafe for B2Client
impl Send for B2Client
impl Sync for B2Client
impl Unpin for B2Client
impl !UnwindSafe for B2Client
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