#[non_exhaustive]pub struct TempOptions { /* private fields */ }Expand description
Options shared by temporary file and temporary directory creation.
§Examples
use qubit_fs::temp::TempOptions;
assert_eq!(TempOptions::default(), TempOptions::new());Implementations§
Source§impl TempOptions
impl TempOptions
Sourcepub const fn parent(&self) -> Option<&Path>
pub const fn parent(&self) -> Option<&Path>
Returns the requested temporary-resource location, if any.
Sourcepub const fn creates_parent(&self) -> bool
pub const fn creates_parent(&self) -> bool
Returns whether missing parent directories are created.
Sourcepub fn with_parent(self, parent: Option<Path>) -> Self
pub fn with_parent(self, parent: Option<Path>) -> Self
Replaces the requested temporary-resource location.
When set, the facade requires hierarchical temporary paths to be strict
descendants of this path and object-key paths to retain its raw prefix.
A provider may return an absolute logical path for a relative
hierarchical parent when the exact component prefix is preserved.
Provider-specific path semantics remain provider-defined. When None,
the provider selects the location.
§Parameters
parent: Requested temporary-resource parent, orNoneto let the provider choose the location.
Sourcepub fn with_prefix(self, prefix: impl Into<String>) -> Self
pub fn with_prefix(self, prefix: impl Into<String>) -> Self
Replaces the generated resource name prefix.
§Parameters
prefix: Name prefix converted into an owned string.
Sourcepub fn with_suffix(self, suffix: impl Into<String>) -> Self
pub fn with_suffix(self, suffix: impl Into<String>) -> Self
Replaces the generated resource name suffix.
§Parameters
suffix: Name suffix converted into an owned string.
Sourcepub const fn with_create_parent(self, create: bool) -> Self
pub const fn with_create_parent(self, create: bool) -> Self
Replaces whether missing parent directories are created.
§Parameters
create: Whether the provider should create a missing parent.
Trait Implementations§
Source§impl Clone for TempOptions
impl Clone for TempOptions
Source§impl Debug for TempOptions
impl Debug for TempOptions
Source§impl Default for TempOptions
impl Default for TempOptions
impl Eq for TempOptions
Source§impl PartialEq for TempOptions
impl PartialEq for TempOptions
impl StructuralPartialEq for TempOptions
Auto Trait Implementations§
impl Forget for TempOptions
impl Freeze for TempOptions
impl Move for TempOptions
impl RefUnwindSafe for TempOptions
impl Send for TempOptions
impl Sync for TempOptions
impl Unpin for TempOptions
impl UnsafeUnpin for TempOptions
impl UnwindSafe for TempOptions
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