pub struct CronManager<E: CommandExecutor = SystemExecutor> { /* private fields */ }Expand description
Cron manager: a managed block inside the user’s crontab.
Cron has no native start/stop process semantics; those operations return
explicit InvalidInput errors instead of pretending success.
Implementations§
Source§impl<E: CommandExecutor> CronManager<E>
impl<E: CommandExecutor> CronManager<E>
Sourcepub fn new(
executor: E,
marker: String,
desired_block: String,
transition_timeout: Duration,
) -> Result<Self, ServiceError>
pub fn new( executor: E, marker: String, desired_block: String, transition_timeout: Duration, ) -> Result<Self, ServiceError>
Creates a cron adapter with a unique marker and exact desired block.
§Errors
ServiceError::InvalidInput when the marker is empty, overlong, or
contains a control character, when the desired block is overlong or
contains a NUL byte, or when the transition timeout is zero or above
MAX_TRANSITION_TIMEOUT.
Trait Implementations§
Source§impl<E: Debug + CommandExecutor> Debug for CronManager<E>
impl<E: Debug + CommandExecutor> Debug for CronManager<E>
Source§impl<E: CommandExecutor> ServiceManager for CronManager<E>
impl<E: CommandExecutor> ServiceManager for CronManager<E>
Source§fn inspect(&self, spec: &ServiceSpec) -> Result<LifecycleSnapshot, ServiceError>
fn inspect(&self, spec: &ServiceSpec) -> Result<LifecycleSnapshot, ServiceError>
Inspects registration and lifecycle state without mutating anything. Read more
Source§fn install(
&mut self,
spec: &ServiceSpec,
) -> Result<TransitionResult, ServiceError>
fn install( &mut self, spec: &ServiceSpec, ) -> Result<TransitionResult, ServiceError>
Source§fn start(
&mut self,
_spec: &ServiceSpec,
_timeout: Duration,
) -> Result<TransitionResult, ServiceError>
fn start( &mut self, _spec: &ServiceSpec, _timeout: Duration, ) -> Result<TransitionResult, ServiceError>
Source§fn stop(
&mut self,
_spec: &ServiceSpec,
_timeout: Duration,
) -> Result<TransitionResult, ServiceError>
fn stop( &mut self, _spec: &ServiceSpec, _timeout: Duration, ) -> Result<TransitionResult, ServiceError>
Source§fn restart(
&mut self,
_spec: &ServiceSpec,
_timeout: Duration,
) -> Result<TransitionResult, ServiceError>
fn restart( &mut self, _spec: &ServiceSpec, _timeout: Duration, ) -> Result<TransitionResult, ServiceError>
Source§fn uninstall(
&mut self,
spec: &ServiceSpec,
) -> Result<TransitionResult, ServiceError>
fn uninstall( &mut self, spec: &ServiceSpec, ) -> Result<TransitionResult, ServiceError>
Removes an
Owned registration. Read moreAuto Trait Implementations§
impl<E> Freeze for CronManager<E>where
E: Freeze,
impl<E> RefUnwindSafe for CronManager<E>where
E: RefUnwindSafe,
impl<E> Send for CronManager<E>where
E: Send,
impl<E> Sync for CronManager<E>where
E: Sync,
impl<E> Unpin for CronManager<E>where
E: Unpin,
impl<E> UnsafeUnpin for CronManager<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for CronManager<E>where
E: UnwindSafe,
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