pub struct TransferManager { /* private fields */ }Expand description
Transfer manager for handling chunked uploads and downloads
Implementations§
Source§impl TransferManager
impl TransferManager
Sourcepub fn new(storage: Arc<dyn CloudStorage>, config: TransferConfig) -> Self
pub fn new(storage: Arc<dyn CloudStorage>, config: TransferConfig) -> Self
Create a new transfer manager
Sourcepub async fn upload(
&self,
key: &str,
data: Bytes,
progress_tx: Option<Sender<TransferProgress>>,
) -> Result<()>
pub async fn upload( &self, key: &str, data: Bytes, progress_tx: Option<Sender<TransferProgress>>, ) -> Result<()>
Sourcepub async fn download(
&self,
key: &str,
progress_tx: Option<Sender<TransferProgress>>,
) -> Result<Bytes>
pub async fn download( &self, key: &str, progress_tx: Option<Sender<TransferProgress>>, ) -> Result<Bytes>
Download data with chunking and retry
§Errors
Returns an error if the download fails after all retries
Sourcepub fn get_status(&self, transfer_id: &str) -> Option<TransferState>
pub fn get_status(&self, transfer_id: &str) -> Option<TransferState>
Get transfer status
Auto Trait Implementations§
impl Freeze for TransferManager
impl !RefUnwindSafe for TransferManager
impl Send for TransferManager
impl Sync for TransferManager
impl Unpin for TransferManager
impl UnsafeUnpin for TransferManager
impl !UnwindSafe for TransferManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.