pub struct SrcDstConfig {
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: bool
Disallowed by default. There may be a potential to open
and create
the same file at the same time.
Implementations§
Source§impl SrcDstConfig
impl SrcDstConfig
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<SrcDstPairs, SrcDstError>>
pub fn parse<P: AsRef<Path>>( &self, src: P, dst: Option<P>, ) -> Result<Result<SrcDstPairs, SrcDstError>>
§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_dir
will be used as output directory. - Stdio will be always treated as a file.
Trait Implementations§
Source§impl Clone for SrcDstConfig
impl Clone for SrcDstConfig
Source§fn clone(&self) -> SrcDstConfig
fn clone(&self) -> SrcDstConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SrcDstConfig
impl Debug for SrcDstConfig
Source§impl PartialEq for SrcDstConfig
impl PartialEq for SrcDstConfig
impl Eq for SrcDstConfig
impl StructuralPartialEq for SrcDstConfig
Auto Trait Implementations§
impl Freeze for SrcDstConfig
impl RefUnwindSafe for SrcDstConfig
impl Send for SrcDstConfig
impl Sync for SrcDstConfig
impl Unpin for SrcDstConfig
impl UnwindSafe for SrcDstConfig
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