Struct weave::SimpleNaming
[−]
[src]
pub struct SimpleNaming { /* fields omitted */ }
The SimpleNaming is a NamingConvention that has a basename, with the main file having a specified extension, the backup file having a ".bak" extension, and the temp files using a numbered extension starting with ".0". If the names are intended to be compressed, a ".gz" suffix can also be added.
Methods
impl SimpleNaming
[src]
fn new<P: AsRef<Path>>(
path: P,
base: &str,
ext: &str,
compressed: bool
) -> SimpleNaming
path: P,
base: &str,
ext: &str,
compressed: bool
) -> SimpleNaming
fn make_name(&self, ext: &str) -> PathBuf
Trait Implementations
impl Debug for SimpleNaming
[src]
impl Clone for SimpleNaming
[src]
fn clone(&self) -> SimpleNaming
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl NamingConvention for SimpleNaming
[src]
fn main_file(&self) -> PathBuf
Return the pathname of the primary file.
fn backup_file(&self) -> PathBuf
Return the pathname of the backup file.
fn temp_file(&self) -> Result<(PathBuf, File)>
Create a temporary file for writing. Upon success, returns the full path of the file, and the opened File for writing to the file. The path should refer to a new file that did not exist prior to this call. Read more
fn is_compressed(&self) -> bool
Return if compression is requested on main file.
fn new_temp(&self) -> Result<WriterInfo>
Open a possibly compressed temp file, returning a WriterInfo for it. The stream will be buffered, and possibly compressed. Read more