pub trait ValidationContext {
// Required methods
fn image_exists(&self, image: &ImageRef) -> Result<bool, ContextError>;
fn secret_exists(&self, secret: &SecretRef) -> Result<bool, ContextError>;
fn mesh_ident_known(
&self,
ident: &MeshIdent,
batch: &[MeshIdent],
) -> Result<bool, ContextError>;
fn cf_zone_owned(&self, hostname: &str) -> Result<bool, ContextError>;
fn tailscale_tag_known(&self, tag: &str) -> Result<bool, ContextError>;
fn capacity_for(
&self,
spec: &WorkloadSpec,
machine_id: &MachineId,
) -> Result<bool, ContextError>;
}Expand description
Read-only view of yubaba state used for semantic validation.
Defined here so clients (desktop, CLI, agents) can run semantic checks without depending on the yubaba crate. Yubaba implements this trait.
Each method returns Result<bool, ContextError> so transient failures are
distinguishable from definitive “not found” answers.
Required Methods§
Sourcefn image_exists(&self, image: &ImageRef) -> Result<bool, ContextError>
fn image_exists(&self, image: &ImageRef) -> Result<bool, ContextError>
True when the registry confirms the image exists.
Sourcefn secret_exists(&self, secret: &SecretRef) -> Result<bool, ContextError>
fn secret_exists(&self, secret: &SecretRef) -> Result<bool, ContextError>
True when the named secret exists in the yubaba secret store.
Sourcefn mesh_ident_known(
&self,
ident: &MeshIdent,
batch: &[MeshIdent],
) -> Result<bool, ContextError>
fn mesh_ident_known( &self, ident: &MeshIdent, batch: &[MeshIdent], ) -> Result<bool, ContextError>
True when ident is a known deployed workload OR appears in batch
(the set of specs co-deployed in the same request — allows forward
references within a single deployment batch).
Sourcefn cf_zone_owned(&self, hostname: &str) -> Result<bool, ContextError>
fn cf_zone_owned(&self, hostname: &str) -> Result<bool, ContextError>
True when hostname falls under a Cloudflare zone owned by this cluster.
Sourcefn tailscale_tag_known(&self, tag: &str) -> Result<bool, ContextError>
fn tailscale_tag_known(&self, tag: &str) -> Result<bool, ContextError>
True when tag (e.g. "tag:noisetable-ops") is in the cluster’s
Tailscale ACL tag list.
Sourcefn capacity_for(
&self,
spec: &WorkloadSpec,
machine_id: &MachineId,
) -> Result<bool, ContextError>
fn capacity_for( &self, spec: &WorkloadSpec, machine_id: &MachineId, ) -> Result<bool, ContextError>
True when machine_id has sufficient remaining capacity to host the
given spec’s resource requirements.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".