pub struct ModelDownloader { /* private fields */ }Expand description
Downloads a single model file with progress, resumable support, SHA256 verification, and atomic rename.
Implementations§
Source§impl ModelDownloader
impl ModelDownloader
Sourcepub fn new(
url: String,
dest: PathBuf,
expected_sha256: String,
total_size: u64,
) -> Self
pub fn new( url: String, dest: PathBuf, expected_sha256: String, total_size: u64, ) -> Self
Create a new ModelDownloader.
Sourcepub async fn download_with_progress(&self) -> Result<()>
pub async fn download_with_progress(&self) -> Result<()>
Download the file with progress bar, resume support, SHA256 verification, and atomic rename. Respects PAPER_OFFLINE=1.
Auto Trait Implementations§
impl !RefUnwindSafe for ModelDownloader
impl !UnwindSafe for ModelDownloader
impl Forget for ModelDownloader
impl Freeze for ModelDownloader
impl Move for ModelDownloader
impl Send for ModelDownloader
impl Sync for ModelDownloader
impl Unpin for ModelDownloader
impl UnsafeUnpin for ModelDownloader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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 more