pub enum CasePattern {
Any,
Literal(Word),
Expanded(Word),
}Expand description
One case alternative.
Bash matches these as filename-style patterns. This shell matches literal text instead, for the
same reason builtins’ grep and sed take literal patterns: a partial wildcard is
the pattern a literal matcher answers wrongly and silently, so it is rejected by name rather
than quietly mismatched. A bare * is kept, because it is the default branch rather than a
wildcard in any meaningful sense.
Variants§
Any
A bare *: the catch-all branch, which matches every subject.
Literal(Word)
A constant pattern, already checked for pattern syntax when it was parsed.
Expanded(Word)
A pattern built from expansions, checked for pattern syntax when it is expanded.
It cannot be checked earlier, because its text does not exist until the script runs — the
same reason grep "$pattern" is checked at run time rather than at parse time.
Trait Implementations§
Source§impl Clone for CasePattern
impl Clone for CasePattern
Source§fn clone(&self) -> CasePattern
fn clone(&self) -> CasePattern
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CasePattern
impl Debug for CasePattern
impl Eq for CasePattern
Source§impl PartialEq for CasePattern
impl PartialEq for CasePattern
impl StructuralPartialEq for CasePattern
Auto Trait Implementations§
impl Freeze for CasePattern
impl RefUnwindSafe for CasePattern
impl Send for CasePattern
impl Sync for CasePattern
impl Unpin for CasePattern
impl UnsafeUnpin for CasePattern
impl UnwindSafe for CasePattern
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
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
key and return true if they are equal.