pub struct ServiceDescriptor { /* private fields */ }Expand description
Immutable definition of one managed service.
Implementations§
Source§impl ServiceDescriptor
impl ServiceDescriptor
Sourcepub fn new(
name: impl Into<String>,
resource: ManagedResource,
restart_policy: RestartPolicy,
) -> SupervisorResult<Self>
pub fn new( name: impl Into<String>, resource: ManagedResource, restart_policy: RestartPolicy, ) -> SupervisorResult<Self>
Creates a service descriptor with no dependencies.
Sourcepub fn with_dependency(
self,
dependency: impl Into<String>,
) -> SupervisorResult<Self>
pub fn with_dependency( self, dependency: impl Into<String>, ) -> SupervisorResult<Self>
Adds one compatibility dependency that permits degraded operation.
Sourcepub fn with_dependency_requirement(
self,
dependency: impl Into<String>,
requirement: DependencyRequirement,
) -> SupervisorResult<Self>
pub fn with_dependency_requirement( self, dependency: impl Into<String>, requirement: DependencyRequirement, ) -> SupervisorResult<Self>
Adds one dependency with an explicit minimum-health requirement.
Sourcepub fn with_activation(self, activation: ServiceActivationState) -> Self
pub fn with_activation(self, activation: ServiceActivationState) -> Self
Replaces the installation activation state.
Sourcepub fn with_critical(self, critical: bool) -> Self
pub fn with_critical(self, critical: bool) -> Self
Marks whether failure affects overall Runtime health.
Sourcepub fn resource(&self) -> ManagedResource
pub fn resource(&self) -> ManagedResource
Returns the owned Runtime resource.
Sourcepub fn dependencies(&self) -> &[ServiceDependency]
pub fn dependencies(&self) -> &[ServiceDependency]
Returns required service dependencies.
Sourcepub fn restart_policy(&self) -> RestartPolicy
pub fn restart_policy(&self) -> RestartPolicy
Returns restart and shutdown policy.
Sourcepub fn activation(&self) -> ServiceActivationState
pub fn activation(&self) -> ServiceActivationState
Returns the installation activation state.
Sourcepub fn is_critical(&self) -> bool
pub fn is_critical(&self) -> bool
Reports whether failure affects overall Runtime health.
Sourcepub fn validate(&self) -> SupervisorResult<()>
pub fn validate(&self) -> SupervisorResult<()>
Validates descriptor and policy invariants.
Trait Implementations§
Source§impl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
Source§fn clone(&self) -> ServiceDescriptor
fn clone(&self) -> ServiceDescriptor
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 ServiceDescriptor
impl Debug for ServiceDescriptor
impl Eq for ServiceDescriptor
Source§impl PartialEq for ServiceDescriptor
impl PartialEq for ServiceDescriptor
impl StructuralPartialEq for ServiceDescriptor
Auto Trait Implementations§
impl Freeze for ServiceDescriptor
impl RefUnwindSafe for ServiceDescriptor
impl Send for ServiceDescriptor
impl Sync for ServiceDescriptor
impl Unpin for ServiceDescriptor
impl UnsafeUnpin for ServiceDescriptor
impl UnwindSafe for ServiceDescriptor
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