pub enum ProcessSelector {
All,
Id(u32),
Name(String),
Regex(Regex),
Fold(String),
Instance {
name: String,
slot: u32,
},
}Expand description
A parsed process selector (spec §9: name, id, all, /regex/, fold:)
Variants§
All
Every sheep in the flock
Id(u32)
By numeric id
Name(String)
By exact name
Regex(Regex)
By regex over names (slash-delimited on the CLI)
Fold(String)
Every sheep in a fold
Instance
One instance of one app, written name:slot on the CLI
Implementations§
Source§impl ProcessSelector
impl ProcessSelector
Sourcepub fn parse(input: &str) -> Result<Self, SelectorError>
pub fn parse(input: &str) -> Result<Self, SelectorError>
Parses CLI selector syntax
§Errors
SelectorError::Empty— empty input.SelectorError::EmptyFold—fold:with no name.SelectorError::BadRegex—/re/body rejected by the regex crate (carries its message).SelectorError::BadGlob— a pattern carrying*,?,[or{was rejected byglobset(carries its message).
Sourcepub const fn is_exact(&self) -> bool
pub const fn is_exact(&self) -> bool
Whether this selector names ONE entry the caller already knew of, by its name or its id, rather than sweeping whatever matches.
The distinction a dog turns on: a dog is a process an operator
installed, not a member of the flock all means, so a wildcard must
pass it by while shep restart metrics still reaches it.
Self::Regex and Self::Fold are wildcards here even when they
happen to match one entry — what matters is that the operator did not
name it.
Trait Implementations§
Source§impl Clone for ProcessSelector
impl Clone for ProcessSelector
Source§fn clone(&self) -> ProcessSelector
fn clone(&self) -> ProcessSelector
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 ProcessSelector
impl Debug for ProcessSelector
Source§impl From<&ProcessSelector> for SelectorSpec
impl From<&ProcessSelector> for SelectorSpec
Source§fn from(sel: &ProcessSelector) -> Self
fn from(sel: &ProcessSelector) -> Self
Source§impl TryFrom<SelectorSpec> for ProcessSelector
impl TryFrom<SelectorSpec> for ProcessSelector
Source§fn try_from(spec: SelectorSpec) -> Result<Self, Self::Error>
fn try_from(spec: SelectorSpec) -> Result<Self, Self::Error>
Compiles a wire selector into a matchable one
§Errors
SelectorError::BadRegex— the peer-supplied pattern fails to compile or exceeds the 1 MiB compiled-size bound.