pub struct WorkloadEffect {
pub kind: String,
pub package_trust: PackageTrust,
pub node_tier: NodeTrustTier,
pub network: NetworkPolicy,
pub secrets: bool,
pub emulated: bool,
pub accelerator: Option<String>,
pub resource_cost: f64,
}Expand description
The effect fields of one workload governance request.
Fields§
§kind: StringWorkload kind (open string: cog, inference, wasm-module, …).
package_trust: PackageTrustPackage provenance.
node_tier: NodeTrustTierTrust tier of the target node.
network: NetworkPolicyRequested network exposure.
secrets: boolWhether secrets are delivered to the instance.
emulated: boolWhether the placement runs under emulation (operator opt-in only).
accelerator: Option<String>Accelerator capability id used, if any (e.g. accel.gpu.metal).
resource_cost: f64Normalised resource cost in [0.0, 1.0] (share of the node).
Implementations§
Source§impl WorkloadEffect
impl WorkloadEffect
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate field ranges and formats (system-boundary check).
Sourcepub fn to_effect_vector(&self) -> EffectVector
pub fn to_effect_vector(&self) -> EffectVector
Derive the 5D effect vector.
- risk: package provenance, raised by emulation.
- security: node tier plus network exposure.
- privacy: secrets plus internet egress.
- novelty: emulation and accelerator use.
- fairness: resource cost (share of a shared node).
Sourcepub fn context_map(&self) -> HashMap<String, String>
pub fn context_map(&self) -> HashMap<String, String>
Flatten the fields into the string context map the engine takes.
Trait Implementations§
Source§impl Clone for WorkloadEffect
impl Clone for WorkloadEffect
Source§impl Debug for WorkloadEffect
impl Debug for WorkloadEffect
Source§impl<'de> Deserialize<'de> for WorkloadEffect
impl<'de> Deserialize<'de> for WorkloadEffect
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for WorkloadEffect
impl PartialEq for WorkloadEffect
Source§impl Serialize for WorkloadEffect
impl Serialize for WorkloadEffect
impl StructuralPartialEq for WorkloadEffect
Auto Trait Implementations§
impl Freeze for WorkloadEffect
impl RefUnwindSafe for WorkloadEffect
impl Send for WorkloadEffect
impl Sync for WorkloadEffect
impl Unpin for WorkloadEffect
impl UnsafeUnpin for WorkloadEffect
impl UnwindSafe for WorkloadEffect
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
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<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> ⓘ
Converts
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> ⓘ
Converts
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