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 even when they
happen to match one entry: 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
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 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
Converts to this type from the input type.
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.
Source§type Error = SelectorError
type Error = SelectorError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for ProcessSelector
impl RefUnwindSafe for ProcessSelector
impl Send for ProcessSelector
impl Sync for ProcessSelector
impl Unpin for ProcessSelector
impl UnsafeUnpin for ProcessSelector
impl UnwindSafe for ProcessSelector
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