#[repr(i32)]pub enum MatchMode {
Unknown = 0,
Prefix = 1,
GlobPath = 2,
GlobString = 3,
}Expand description
How to match |pattern| against the name of the mapping. Note for future extensions: unrecognised enums are treated as always matching.
Variants§
Unknown = 0
Prefix = 1
The pattern matches if it is a prefix of the mapping name.
GlobPath = 2
The pattern is matched against the mapping name as a pathname glob (see “man 7 glob” and FNM_PATHNAME in “man 3 fnmatch”). The key distinction is that path separators in the name are not matched against wildcards. So a pattern of the form “/usr/*/llvm” would match “/usr/lib/llvm” but not “/usr/lib/nested/llvm”. Note: any “(deleted)” suffix is excluded before matching.
GlobString = 3
The pattern is matched against the mapping name without special-casing path separators. So a pattern of the form “/usr/*/llvm” would match both “/usr/lib/llvm” and “/usr/lib/nested/llvm”. Note: any “(deleted)” suffix is excluded before matching.
Implementations§
Source§impl MatchMode
impl MatchMode
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<Self>
pub fn from_str_name(value: &str) -> Option<Self>
Creates an enum from field names used in the ProtoBuf definition.