pub struct DownloadBuilder<'a> { /* private fields */ }Expand description
Builder for configuring and running a model download.
Use this builder when combining optional settings like progress and cancellation.
Implementations§
Source§impl<'a> DownloadBuilder<'a>
impl<'a> DownloadBuilder<'a>
Sourcepub fn progress<F>(self, callback: F) -> Self
pub fn progress<F>(self, callback: F) -> Self
Report download progress as a percentage from 0.0 to 100.0.
Sourcepub fn cancel(self, cancel_flag: Arc<AtomicBool>) -> Self
pub fn cancel(self, cancel_flag: Arc<AtomicBool>) -> Self
Cancel the download when cancel_flag is set to true.
Sourcepub async fn run(self) -> Result<(), FoundryLocalError>
pub async fn run(self) -> Result<(), FoundryLocalError>
Run the configured download.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DownloadBuilder<'a>
impl<'a> !Sync for DownloadBuilder<'a>
impl<'a> !UnwindSafe for DownloadBuilder<'a>
impl<'a> Freeze for DownloadBuilder<'a>
impl<'a> Send for DownloadBuilder<'a>
impl<'a> Unpin for DownloadBuilder<'a>
impl<'a> UnsafeUnpin for DownloadBuilder<'a>
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