pub struct ConcurrentUploader<H: UploadHandler> { /* private fields */ }Expand description
Generic concurrent uploader.
Manages a JoinSet of upload tasks bounded by max_concurrent.
Resumes pending uploads on startup. Drains in-flight on shutdown.
Implementations§
Source§impl<H: UploadHandler> ConcurrentUploader<H>
impl<H: UploadHandler> ConcurrentUploader<H>
Sourcepub async fn run(
&self,
rx: Receiver<UploadMessage<H::Id>>,
) -> Result<UploaderStats>
pub async fn run( &self, rx: Receiver<UploadMessage<H::Id>>, ) -> Result<UploaderStats>
Run the uploader loop. Blocks until Shutdown or channel close.
Sourcepub async fn stats(&self) -> UploaderStats
pub async fn stats(&self) -> UploaderStats
Get current upload statistics.
Auto Trait Implementations§
impl<H> Freeze for ConcurrentUploader<H>
impl<H> !RefUnwindSafe for ConcurrentUploader<H>
impl<H> Send for ConcurrentUploader<H>
impl<H> Sync for ConcurrentUploader<H>
impl<H> Unpin for ConcurrentUploader<H>
impl<H> UnsafeUnpin for ConcurrentUploader<H>
impl<H> !UnwindSafe for ConcurrentUploader<H>
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.