pub struct EnvironmentPattern { /* private fields */ }Expand description
A wildcard pattern matched against an environment variable name.
The pattern language is deliberately small and portable: * matches zero
or more Unicode scalar values and ? matches one. Matching is
case-insensitive so the same policy is safe on POSIX and Windows hosts.
Implementations§
Source§impl EnvironmentPattern
impl EnvironmentPattern
Sourcepub fn new(pattern: impl Into<String>) -> Result<Self, CommandError>
pub fn new(pattern: impl Into<String>) -> Result<Self, CommandError>
Creates a validated environment-variable pattern.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the original pattern text.
Trait identity is based on the same case-insensitive canonical form as
Self::matches, while this accessor preserves the caller’s spelling
for diagnostics and serialization.
Trait Implementations§
Source§impl Clone for EnvironmentPattern
impl Clone for EnvironmentPattern
Source§fn clone(&self) -> EnvironmentPattern
fn clone(&self) -> EnvironmentPattern
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EnvironmentPattern
impl Debug for EnvironmentPattern
impl Eq for EnvironmentPattern
Source§impl Hash for EnvironmentPattern
impl Hash for EnvironmentPattern
Source§impl Ord for EnvironmentPattern
impl Ord for EnvironmentPattern
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for EnvironmentPattern
impl PartialEq for EnvironmentPattern
Source§impl PartialOrd for EnvironmentPattern
impl PartialOrd for EnvironmentPattern
Auto Trait Implementations§
impl Freeze for EnvironmentPattern
impl RefUnwindSafe for EnvironmentPattern
impl Send for EnvironmentPattern
impl Sync for EnvironmentPattern
impl Unpin for EnvironmentPattern
impl UnsafeUnpin for EnvironmentPattern
impl UnwindSafe for EnvironmentPattern
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