Type Definition shared_files::SharedTemporaryFile
source · pub type SharedTemporaryFile = SharedFile<TempFile>;Available on crate feature
async-tempfile only.Expand description
A type alias for a SharedFile wrapping a TempFile.
Implementations§
sourcepub async fn from_existing(
path: PathBuf,
ownership: Ownership
) -> Result<SharedFile<TempFile>, Error>
pub async fn from_existing( path: PathBuf, ownership: Ownership ) -> Result<SharedFile<TempFile>, Error>
Wraps a new instance of this type around an existing file. This is a convencience
wrapper around TempFile::from_existing and SharedFile::from.
If ownership is set to Ownership::Borrowed, this method does not take ownership of
the file, i.e. the file will not be deleted when the instance is dropped.
Arguments
path- The path of the file to wrap.ownership- The ownership of the file.