pub struct TempFile { /* private fields */ }Expand description
Temporary file handle that automatically cleans up on drop
Implementations§
Source§impl TempFile
impl TempFile
Sourcepub async fn new() -> StorageResult<Self>
pub async fn new() -> StorageResult<Self>
Create a new temporary file
Sourcepub async fn with_extension(extension: &str) -> StorageResult<Self>
pub async fn with_extension(extension: &str) -> StorageResult<Self>
Create a temporary file with a specific extension
Sourcepub fn keep_on_drop(self) -> Self
pub fn keep_on_drop(self) -> Self
Keep the file when this handle is dropped
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TempFile
impl RefUnwindSafe for TempFile
impl Send for TempFile
impl Sync for TempFile
impl Unpin for TempFile
impl UnsafeUnpin for TempFile
impl UnwindSafe for TempFile
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