pub struct FileDownload { /* private fields */ }Expand description
A handle to a single downloadable output. A download password given at
conversion time (or to Api2Convert::download)
is remembered here and sent automatically; an explicit password argument to
save / contents overrides it for that call.
Implementations§
Source§impl FileDownload
impl FileDownload
Sourcepub fn output(&self) -> &OutputFile
pub fn output(&self) -> &OutputFile
The underlying output metadata.
Sourcepub fn save(
&self,
path_or_dir: impl AsRef<Path>,
download_password: Option<&str>,
) -> Result<PathBuf>
pub fn save( &self, path_or_dir: impl AsRef<Path>, download_password: Option<&str>, ) -> Result<PathBuf>
Stream the download to disk. If path_or_dir is an existing directory
(or ends with a path separator) the API filename is appended, sanitized
against path traversal. Returns the path written.
Auto Trait Implementations§
impl !RefUnwindSafe for FileDownload
impl !UnwindSafe for FileDownload
impl Freeze for FileDownload
impl Send for FileDownload
impl Sync for FileDownload
impl Unpin for FileDownload
impl UnsafeUnpin for FileDownload
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