Enum multipart::server::save::SaveDir [−][src]
Expand description
The save directory for Entries
. May be temporary (delete-on-drop) or permanent.
Variants
Temp(TempDir)
This directory is temporary and will be deleted, along with its contents, when this wrapper is dropped.
Perm(PathBuf)
This directory is permanent and will be left on the filesystem when this wrapper is dropped.
N.B. If this directory is in the OS temporary directory then it may still be deleted at any time.
Implementations
impl SaveDir
[src]
impl SaveDir
[src]pub fn is_temporary(&self) -> bool
[src]
pub fn is_temporary(&self) -> bool
[src]Returns true
if this is a temporary directory which will be deleted on-drop.
pub fn into_path(self) -> PathBuf
[src]
pub fn into_path(self) -> PathBuf
[src]Unwrap the PathBuf
from self
; if this is a temporary directory,
it will be converted to a permanent one.
pub fn keep(&mut self)
[src]
pub fn keep(&mut self)
[src]If this SaveDir
is temporary, convert it to permanent.
This is a no-op if it already is permanent.
Warning: Potential Data Loss
Even though this will prevent deletion on-drop, the temporary folder on most OSes (where this directory is created by default) can be automatically cleared by the OS at any time, usually on reboot or when free space is low.
It is recommended that you relocate the files from a request which you want to keep to a permanent folder on the filesystem.
pub fn delete(self) -> Result<()>
[src]
pub fn delete(self) -> Result<()>
[src]Delete this directory and its contents, regardless of its permanence.
Warning: Potential Data Loss
This is very likely irreversible, depending on the OS implementation.
Files deleted programmatically are deleted directly from disk, as compared to most file manager applications which use a staging area from which deleted files can be safely recovered (i.e. Windows’ Recycle Bin, OS X’s Trash Can, etc.).
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SaveDir
impl Send for SaveDir
impl Sync for SaveDir
impl Unpin for SaveDir
impl UnwindSafe for SaveDir
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DebugAny for T where
T: Any + Debug,
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
T: Any,