Struct fencryption_lib::tmp::TmpFile
source · pub struct TmpFile(_);Expand description
TmpFile is a struct to manipulate a temporary file.
When this struct is dropped, the temporary file itself is automatically deleted.
Implementations
sourceimpl TmpFile
impl TmpFile
pub fn new() -> Result<Self, Error>
pub fn path(&self) -> &PathBuf
sourcepub fn write_file<C>(&self, contents: C) -> Result<()>where
C: AsRef<[u8]>,
pub fn write_file<C>(&self, contents: C) -> Result<()>where
C: AsRef<[u8]>,
Writes to the temporary file. See fs::write.
sourcepub fn open(&self) -> Result<File>
pub fn open(&self) -> Result<File>
Opens the temporary file. See File::open.
sourcepub fn open_with_opts(&self, opts: &mut OpenOptions) -> Result<File>
pub fn open_with_opts(&self, opts: &mut OpenOptions) -> Result<File>
Opens the temporary file using the provided OpenOptions.
See fs::OpenOptions::open.
Auto Trait Implementations
impl RefUnwindSafe for TmpFile
impl Send for TmpFile
impl Sync for TmpFile
impl Unpin for TmpFile
impl UnwindSafe for TmpFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more