pub enum WriteMode {
Truncate,
Append,
TruncateBoth,
AppendBoth,
Clobber,
}Expand description
How an output redirect opens its target. All three land the same bytes somewhere, so they
classify identically — the distinction is kept so --explain can echo the command the user
actually typed rather than a normalized one. Mutually exclusive by construction: >>| is not
a redirect, and a bool pair would let a generator build one.
Variants§
Truncate
> — truncate.
Append
>> — append.
TruncateBoth
&> (and the equivalent >&FILE) — stdout AND stderr to the file, truncating. Both
streams land on ONE target, so the locus gate has exactly one path to judge, the same as
>; the variant exists so --explain echoes the operator that was typed.
AppendBoth
&>> — stdout AND stderr to the file, appending.
Clobber
>| — truncate, overriding noclobber (POSIX 2.7.2).
Trait Implementations§
impl Copy for WriteMode
impl Eq for WriteMode
impl StructuralPartialEq for WriteMode
Auto Trait Implementations§
impl Freeze for WriteMode
impl RefUnwindSafe for WriteMode
impl Send for WriteMode
impl Sync for WriteMode
impl Unpin for WriteMode
impl UnsafeUnpin for WriteMode
impl UnwindSafe for WriteMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.