pub enum TaskKind {
MemoryCleanup,
SkillRefresh,
HealthCheck,
UpdateCheck,
Experiment,
Custom(String),
}Expand description
Identifies what type of work a scheduled task performs.
Built-in variants map to well-known agent subsystems. TaskKind::Custom
carries an arbitrary string so callers can define their own task kinds without
modifying this enum.
§Persistence
Each variant serialises to a stable snake_case string via TaskKind::as_str
and deserialises via TaskKind::from_str_kind. These strings are stored in
the kind column of the scheduled_jobs table.
§Examples
use zeph_scheduler::TaskKind;
assert_eq!(TaskKind::HealthCheck.as_str(), "health_check");
assert_eq!(TaskKind::from_str_kind("memory_cleanup"), TaskKind::MemoryCleanup);
assert_eq!(TaskKind::from_str_kind("my_custom"), TaskKind::Custom("my_custom".into()));Variants§
MemoryCleanup
Triggers the memory subsystem’s cleanup / compaction routine.
SkillRefresh
Reloads skills from the skill registry.
HealthCheck
Runs a liveness or readiness probe for the agent.
UpdateCheck
Checks the GitHub releases API for a newer Zeph version.
Experiment
Runs an experiment task (used by zeph-experiments).
Custom(String)
An application-defined task kind. The string is the persistence key.
Implementations§
Source§impl TaskKind
impl TaskKind
Sourcepub fn from_str_kind(s: &str) -> Self
pub fn from_str_kind(s: &str) -> Self
Parse a task kind from its persistence string.
Unknown strings are wrapped in TaskKind::Custom rather than returning
an error, so new built-in variants added in future versions do not break
existing stored jobs loaded with an older build.
§Examples
use zeph_scheduler::TaskKind;
assert_eq!(TaskKind::from_str_kind("health_check"), TaskKind::HealthCheck);
assert_eq!(TaskKind::from_str_kind("unknown"), TaskKind::Custom("unknown".into()));Trait Implementations§
impl Eq for TaskKind
impl StructuralPartialEq for TaskKind
Auto Trait Implementations§
impl Freeze for TaskKind
impl RefUnwindSafe for TaskKind
impl Send for TaskKind
impl Sync for TaskKind
impl Unpin for TaskKind
impl UnsafeUnpin for TaskKind
impl UnwindSafe for TaskKind
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more