Skip to main content

CronManager

Struct CronManager 

Source
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>

Source

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.

Source

pub fn marker(&self) -> &str

Returns the marker.

Trait Implementations§

Source§

impl<E: Debug + CommandExecutor> Debug for CronManager<E>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<E: CommandExecutor> ServiceManager for CronManager<E>

Source§

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>

Installs/registers. Allowed for Absent (creation) or Owned (refresh). Read more
Source§

fn start( &mut self, _spec: &ServiceSpec, _timeout: Duration, ) -> Result<TransitionResult, ServiceError>

Starts an Owned stopped service within timeout. Read more
Source§

fn stop( &mut self, _spec: &ServiceSpec, _timeout: Duration, ) -> Result<TransitionResult, ServiceError>

Stops an Owned service within timeout. Read more
Source§

fn restart( &mut self, _spec: &ServiceSpec, _timeout: Duration, ) -> Result<TransitionResult, ServiceError>

Restarts an Owned service within timeout. Read more
Source§

fn uninstall( &mut self, spec: &ServiceSpec, ) -> Result<TransitionResult, ServiceError>

Removes an Owned registration. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.