pub enum LifecycleArchetype {
Server,
Appliance,
Job,
}Expand description
Explicit lifecycle archetype for a kind = "container" workload (W244).
The question that actually matters to a scheduler: “can I kill this and
recreate it somewhere else?” Before this field existed, the answer was
inferred per-spec from volumes.is_empty() + restart_policy — fragile
absence-as-policy, the same trap W243 calls out on the node-taint side.
This type makes the answer structural instead of guessed.
This ticket (R572-F1) adds the discriminator only. The reconciler does not yet branch on it (R572-F4) and neither does the scheduler (R572-F5).
Variants§
Server
k8s analogue: Deployment. Stateless and fungible — the scheduler may move it, scale it to N replicas, or restart it on a different node with zero consequence. Drainable.
Appliance
k8s analogue: StatefulSet. Stable identity + a volume that must follow it; at most one live instance. Not drainable — the reconciler must not schedule it onto a different node. Example: a postgres peer, headscale (W267/R591).
Job
k8s analogue: Job. Runs to completion with declared inputs/outputs,
then is gone — no steady-state identity. almanac is the first
job-family member; forge runs (WorkloadSpec::for_forge, used by QED)
are the container-kind instance of this archetype.
Implementations§
Source§impl LifecycleArchetype
impl LifecycleArchetype
Sourcepub const ALL: [LifecycleArchetype; 3]
pub const ALL: [LifecycleArchetype; 3]
Every variant, in declaration order. Exists so a consumer can enumerate
the archetypes without hand-maintaining a parallel list — the taint
vocabulary in cloud::config::taint_effect is built from this, so
adding a fourth archetype extends the set of live repel keys for free.
Sourcepub fn taint_key(&self) -> &'static str
pub fn taint_key(&self) -> &'static str
The repel-taint key for this archetype (R572-F5). A node carrying the
taint "no-<key>" absolutely rejects workloads of this class.
Examples: Server → "server" (repelled by "no-server");
Appliance → "appliance" (repelled by "no-appliance").
W305/R742-T4: there is no toleration. Earlier prose here and in
cloud::config called this “repel-unless-tolerate”; the unless was
never built, and reading it as a preference is what made no-appliance
on the dev Pis look advisory when it was an unconditional block.
Trait Implementations§
Source§impl Clone for LifecycleArchetype
impl Clone for LifecycleArchetype
Source§fn clone(&self) -> LifecycleArchetype
fn clone(&self) -> LifecycleArchetype
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LifecycleArchetype
Source§impl Debug for LifecycleArchetype
impl Debug for LifecycleArchetype
Source§impl<'de> Deserialize<'de> for LifecycleArchetype
impl<'de> Deserialize<'de> for LifecycleArchetype
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for LifecycleArchetype
Source§impl PartialEq for LifecycleArchetype
impl PartialEq for LifecycleArchetype
Source§impl Serialize for LifecycleArchetype
impl Serialize for LifecycleArchetype
impl StructuralPartialEq for LifecycleArchetype
Source§impl TS for LifecycleArchetype
impl TS for LifecycleArchetype
Source§type WithoutGenerics = LifecycleArchetype
type WithoutGenerics = LifecycleArchetype
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = LifecycleArchetype
type OptionInnerType = LifecycleArchetype
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
Source§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export. Read moreSource§fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
fn export_to_string(cfg: &Config) -> Result<String, ExportError>where
Self: 'static,
Auto Trait Implementations§
impl Freeze for LifecycleArchetype
impl RefUnwindSafe for LifecycleArchetype
impl Send for LifecycleArchetype
impl Sync for LifecycleArchetype
impl Unpin for LifecycleArchetype
impl UnsafeUnpin for LifecycleArchetype
impl UnwindSafe for LifecycleArchetype
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.