pub struct DownloadQueue { /* private fields */ }Implementations§
Source§impl DownloadQueue
impl DownloadQueue
pub fn new() -> Arc<Self> ⓘ
pub fn subscribe(&self) -> Receiver<DownloadEvent>
Sourcepub async fn listing(&self) -> DownloadsListing
pub async fn listing(&self) -> DownloadsListing
Returns the current active/queued/history snapshot.
Sourcepub async fn enqueue(
&self,
model: String,
) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
pub async fn enqueue( &self, model: String, ) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
Enqueue a model for download. Returns (job_id, position, outcome).
Position 0 means the job will run immediately after the driver wakes;
N means N jobs are ahead. Duplicate enqueue returns the existing id.
Sourcepub async fn enqueue_recipe(
&self,
payload: RecipePayload,
) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
pub async fn enqueue_recipe( &self, payload: RecipePayload, ) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
Enqueue a recipe-driven download (Civitai single-file checkpoint).
Returns (job_id, position, outcome). Dedupes on payload.catalog_id
— re-enqueuing the same recipe returns the existing job id so the
SPA’s idempotent retry doesn’t double-pull.
Recipe jobs use the catalog id (e.g. cv:618692) as DownloadJob.model
so the drawer / API listing show something meaningful. The driver task
looks up the recipe payload by job id and dispatches to the recipe
driver instead of the manifest driver.
Sourcepub async fn enqueue_in_group(
&self,
model: String,
catalog_id: &str,
) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
pub async fn enqueue_in_group( &self, model: String, catalog_id: &str, ) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
Enqueue a manifest model and bind the resulting job to a catalog
group. Same return shape as Self::enqueue; an AlreadyPresent
outcome still registers the existing job into the group, so a
catalog-driven enqueue that races with a manual mold pull of the
same companion still gets its membership tracked correctly.
Sourcepub async fn enqueue_recipe_in_group(
&self,
payload: RecipePayload,
catalog_id: &str,
) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
pub async fn enqueue_recipe_in_group( &self, payload: RecipePayload, catalog_id: &str, ) -> Result<(String, usize, EnqueueOutcome), EnqueueError>
Recipe-pull variant of Self::enqueue_in_group. Catalog id is
taken from the payload, so callers don’t pass it twice.
Auto Trait Implementations§
impl !Freeze for DownloadQueue
impl !RefUnwindSafe for DownloadQueue
impl !UnwindSafe for DownloadQueue
impl Send for DownloadQueue
impl Sync for DownloadQueue
impl Unpin for DownloadQueue
impl UnsafeUnpin for DownloadQueue
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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>
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>
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 more