pub enum TempResources {}Expand description
Namespace for temporary resource creation helpers.
Implementations§
Source§impl TempResources
impl TempResources
Sourcepub fn create_file(
fs: Arc<dyn FileSystem>,
options: &TempFileOptions,
) -> FsResult<Box<dyn TempFile>>
pub fn create_file( fs: Arc<dyn FileSystem>, options: &TempFileOptions, ) -> FsResult<Box<dyn TempFile>>
Creates a temporary file.
§Parameters
fs: Filesystem that will own the temporary path.options: Temporary file options.
§Returns
Native or managed temporary file handle.
§Errors
Returns crate::FsError when native temporary file creation fails or
the managed fallback cannot reserve the temporary file.
Sourcepub fn create_default_file(
fs: Arc<dyn FileSystem>,
) -> FsResult<Box<dyn TempFile>>
pub fn create_default_file( fs: Arc<dyn FileSystem>, ) -> FsResult<Box<dyn TempFile>>
Creates a temporary file with default options.
§Parameters
fs: Filesystem that will own the temporary path.
§Returns
Temporary file handle.
§Errors
Returns crate::FsError when the temporary file cannot be created.
Sourcepub fn create_file_with_prefix(
fs: Arc<dyn FileSystem>,
prefix: &str,
) -> FsResult<Box<dyn TempFile>>
pub fn create_file_with_prefix( fs: Arc<dyn FileSystem>, prefix: &str, ) -> FsResult<Box<dyn TempFile>>
Creates a temporary file with a custom name prefix.
§Parameters
fs: Filesystem that will own the temporary path.prefix: Name prefix.
§Returns
Temporary file handle.
§Errors
Returns crate::FsError when the temporary file cannot be created.
Sourcepub fn create_dir(
fs: Arc<dyn FileSystem>,
options: &TempDirOptions,
) -> FsResult<Box<dyn TempDir>>
pub fn create_dir( fs: Arc<dyn FileSystem>, options: &TempDirOptions, ) -> FsResult<Box<dyn TempDir>>
Creates a temporary directory.
§Parameters
fs: Filesystem that will own the temporary path.options: Temporary directory options.
§Returns
Native or managed temporary directory handle.
§Errors
Returns crate::FsError when native temporary directory creation fails
or the managed fallback cannot create the temporary directory.
Sourcepub fn create_default_dir(fs: Arc<dyn FileSystem>) -> FsResult<Box<dyn TempDir>>
pub fn create_default_dir(fs: Arc<dyn FileSystem>) -> FsResult<Box<dyn TempDir>>
Creates a temporary directory with default options.
§Parameters
fs: Filesystem that will own the temporary path.
§Returns
Temporary directory handle.
§Errors
Returns crate::FsError when the temporary directory cannot be
created.
Sourcepub fn create_dir_with_prefix(
fs: Arc<dyn FileSystem>,
prefix: &str,
) -> FsResult<Box<dyn TempDir>>
pub fn create_dir_with_prefix( fs: Arc<dyn FileSystem>, prefix: &str, ) -> FsResult<Box<dyn TempDir>>
Creates a temporary directory with a custom name prefix.
§Parameters
fs: Filesystem that will own the temporary path.prefix: Name prefix.
§Returns
Temporary directory handle.
§Errors
Returns crate::FsError when the temporary directory cannot be
created.