pub enum ServiceSelection {
All,
Only(Vec<DaemonServiceKind>),
}Expand description
Which default-registry services a daemon should host.
Variants§
All
Host every service — the default when nothing is specified.
Only(Vec<DaemonServiceKind>)
Host exactly these services (deduped, first-seen order, non-empty).
Implementations§
Source§impl ServiceSelection
impl ServiceSelection
Sourcepub fn includes(&self, kind: DaemonServiceKind) -> bool
pub fn includes(&self, kind: DaemonServiceKind) -> bool
Whether kind is hosted under this selection.
Sourcepub fn to_csv(&self) -> Option<String>
pub fn to_csv(&self) -> Option<String>
The selection as a --services CSV value: Some("a,b") for a subset,
None when hosting everything (so the launcher bakes no argument).
Sourcepub fn resolve(flag: &[DaemonServiceKind], env: Option<&str>) -> Self
pub fn resolve(flag: &[DaemonServiceKind], env: Option<&str>) -> Self
Resolves the selection from the CLI flag values and an optional env-var value. Pure (no environment access) so it is unit-testable.
Precedence: a non-empty flag wins outright; otherwise the env CSV is
parsed (blank and unknown tokens are warn-and-skipped); an empty result
means host everything (ServiceSelection::All).
Sourcepub fn from_flag_or_env(flag: &[DaemonServiceKind]) -> Self
pub fn from_flag_or_env(flag: &[DaemonServiceKind]) -> Self
Reads SERVICES_ENV and delegates to resolve. Used by
daemon run (build side) and daemon start (bake side).
Sourcepub fn from_service_names<'a>(names: impl IntoIterator<Item = &'a str>) -> Self
pub fn from_service_names<'a>(names: impl IntoIterator<Item = &'a str>) -> Self
Builds a selection from live service names (a running daemon’s status),
for daemon restart’s subset-preserving path. Unknown names are ignored;
an empty result means host everything.
Trait Implementations§
Source§impl Clone for ServiceSelection
impl Clone for ServiceSelection
Source§fn clone(&self) -> ServiceSelection
fn clone(&self) -> ServiceSelection
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 ServiceSelection
impl Debug for ServiceSelection
impl Eq for ServiceSelection
Source§impl PartialEq for ServiceSelection
impl PartialEq for ServiceSelection
impl StructuralPartialEq for ServiceSelection
Auto Trait Implementations§
impl Freeze for ServiceSelection
impl RefUnwindSafe for ServiceSelection
impl Send for ServiceSelection
impl Sync for ServiceSelection
impl Unpin for ServiceSelection
impl UnsafeUnpin for ServiceSelection
impl UnwindSafe for ServiceSelection
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.