Struct atomicwrites::AtomicFile
[−]
[src]
pub struct AtomicFile { /* fields omitted */ }Methods
impl AtomicFile[src]
impl AtomicFilepub fn new<P: AsRef<Path>>(path: P, overwrite: OverwriteBehavior) -> Self[src]
pub fn new<P: AsRef<Path>>(path: P, overwrite: OverwriteBehavior) -> SelfHelper for writing to path in write-only mode.
If DisallowOverwrite is given, errors will be returned from self.write(...) if the file
exists.
pub fn new_with_tmpdir<P: AsRef<Path>>(
path: P,
overwrite: OverwriteBehavior,
tmpdir: P
) -> Self[src]
pub fn new_with_tmpdir<P: AsRef<Path>>(
path: P,
overwrite: OverwriteBehavior,
tmpdir: P
) -> Selfpub fn path(&self) -> &Path[src]
pub fn path(&self) -> &PathGet the target filepath.
pub fn write<T, E, F>(&self, f: F) -> Result<T, Error<E>> where
F: FnOnce(&mut File) -> Result<T, E>, [src]
pub fn write<T, E, F>(&self, f: F) -> Result<T, Error<E>> where
F: FnOnce(&mut File) -> Result<T, E>, Open a temporary file, call f on it (which is supposed to write to it), then move the
file atomically to self.path.
Trait Implementations
Auto Trait Implementations
impl Send for AtomicFile
impl Send for AtomicFileimpl Sync for AtomicFile
impl Sync for AtomicFile