Struct src_dst_clarifier::ParseConfig
source · pub struct ParseConfig {
pub allow_from_stdin: bool,
pub allow_to_stdout: bool,
pub auto_tnamed_dst_file: bool,
pub auto_tnamed_dst_dir: bool,
pub default_extension: OsString,
pub allow_inplace: bool,
}Expand description
Use single hyphen (-) as path to indicate IO from Stdio.
Notes
- Auto time-based unique naming (
auto_tnamed_dst_) only takes effect when DST is not provided.
Fields§
§allow_from_stdin: bool§allow_to_stdout: bool§auto_tnamed_dst_file: bool§auto_tnamed_dst_dir: bool§default_extension: OsString§allow_inplace: boolDisallowed by default. There may be a potential to open and create the same file at the same time.
Implementations§
source§impl ParseConfig
impl ParseConfig
pub fn new<S: AsRef<OsStr>>(default_extension: S) -> Self
pub fn new_with_allow_inplace<S: AsRef<OsStr>>(default_extension: S) -> Self
sourcepub fn parse<P: AsRef<Path>>(
&self,
src: P,
dst: Option<P>
) -> Result<Result<IoPairs, ParseError>>
pub fn parse<P: AsRef<Path>>( &self, src: P, dst: Option<P> ) -> Result<Result<IoPairs, ParseError>>
Possible Combinations
SRC => DST: Stdout,6 File Dir NotProvided
Stdin,6 1+2 1 1 1+3,5
File 2 ✓ ✓ 3
Dir × × ✓ 4
allow_from_stdin.allow_to_stdout.auto_tnamed_dst_file.auto_tnamed_dst_dir. Note: A directory with specified name will not be created automatically (an error will be returned if it does not exist).- Note that
std::env::current_dirwill be used as output directory. - Stdio will be always treated as a file.
Trait Implementations§
source§impl Clone for ParseConfig
impl Clone for ParseConfig
source§fn clone(&self) -> ParseConfig
fn clone(&self) -> ParseConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for ParseConfig
impl Debug for ParseConfig
source§impl PartialEq<ParseConfig> for ParseConfig
impl PartialEq<ParseConfig> for ParseConfig
source§fn eq(&self, other: &ParseConfig) -> bool
fn eq(&self, other: &ParseConfig) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for ParseConfig
impl StructuralEq for ParseConfig
impl StructuralPartialEq for ParseConfig
Auto Trait Implementations§
impl RefUnwindSafe for ParseConfig
impl Send for ParseConfig
impl Sync for ParseConfig
impl Unpin for ParseConfig
impl UnwindSafe for ParseConfig
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