pub struct EvaluationWireEnvelopeV1 {
pub schema: String,
pub version: u16,
pub kind: EvaluationWireKindV1,
pub payload: Value,
}Expand description
A strict, versioned envelope carrying one evaluation substrate value.
The envelope uses a JSON Value for the payload so the same transport can
cross Node, Python, and Go without requiring those SDKs to instantiate Rust
types. Self::validate immediately decodes the value into the closed
payload type selected by kind, preserving Rust-side validation and
rejecting unknown payload fields.
Fields§
§schema: String§version: u16§kind: EvaluationWireKindV1§payload: ValueImplementations§
Source§impl EvaluationWireEnvelopeV1
impl EvaluationWireEnvelopeV1
Sourcepub fn new(
kind: EvaluationWireKindV1,
payload: Value,
) -> Result<Self, EvaluationProtocolError>
pub fn new( kind: EvaluationWireKindV1, payload: Value, ) -> Result<Self, EvaluationProtocolError>
Construct and validate an envelope from an arbitrary JSON payload.
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, EvaluationProtocolError>
pub fn from_slice(bytes: &[u8]) -> Result<Self, EvaluationProtocolError>
Decode and validate a bounded JSON wire message.
Sourcepub fn from_value(value: Value) -> Result<Self, EvaluationProtocolError>
pub fn from_value(value: Value) -> Result<Self, EvaluationProtocolError>
Decode and validate a JSON value at the process boundary.
Sourcepub fn to_vec(&self) -> Result<Vec<u8>, EvaluationProtocolError>
pub fn to_vec(&self) -> Result<Vec<u8>, EvaluationProtocolError>
Encode a validated envelope with the process-boundary size limit.
Sourcepub fn validate(&self) -> Result<(), EvaluationProtocolError>
pub fn validate(&self) -> Result<(), EvaluationProtocolError>
Validate envelope identity, bounded encoding, and the selected payload.
Sourcepub const fn kind(&self) -> EvaluationWireKindV1
pub const fn kind(&self) -> EvaluationWireKindV1
Return the payload kind without exposing a second string authority.
Sourcepub fn from_evidence_read_request(
payload: EvidenceReadRequestV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_evidence_read_request( payload: EvidenceReadRequestV1, ) -> Result<Self, EvaluationProtocolError>
Construct an evidence read request envelope.
Sourcepub fn from_evidence_snapshot(
payload: EvidenceSnapshotV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_evidence_snapshot( payload: EvidenceSnapshotV1, ) -> Result<Self, EvaluationProtocolError>
Construct an evidence snapshot envelope.
Sourcepub fn from_auxiliary_run_spec(
payload: AuxiliaryRunSpecV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_auxiliary_run_spec( payload: AuxiliaryRunSpecV1, ) -> Result<Self, EvaluationProtocolError>
Construct an auxiliary specification envelope.
Sourcepub fn from_auxiliary_run_snapshot(
payload: AuxiliaryRunSnapshotV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_auxiliary_run_snapshot( payload: AuxiliaryRunSnapshotV1, ) -> Result<Self, EvaluationProtocolError>
Construct an auxiliary lifecycle snapshot envelope.
Sourcepub fn from_auxiliary_run_output(
payload: AuxiliaryRunOutputV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_auxiliary_run_output( payload: AuxiliaryRunOutputV1, ) -> Result<Self, EvaluationProtocolError>
Construct an auxiliary output envelope.
Sourcepub fn from_evaluation_result(
payload: EvaluationResultV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_evaluation_result( payload: EvaluationResultV1, ) -> Result<Self, EvaluationProtocolError>
Construct an evaluation result envelope.
Sourcepub fn from_evaluation_record(
payload: EvaluationRecordV1,
) -> Result<Self, EvaluationProtocolError>
pub fn from_evaluation_record( payload: EvaluationRecordV1, ) -> Result<Self, EvaluationProtocolError>
Construct an immutable evaluation record envelope.
Sourcepub fn payload_as<T>(
&self,
expected: EvaluationWireKindV1,
) -> Result<T, EvaluationProtocolError>where
T: DeserializeOwned,
pub fn payload_as<T>(
&self,
expected: EvaluationWireKindV1,
) -> Result<T, EvaluationProtocolError>where
T: DeserializeOwned,
Decode a typed payload after checking that the envelope kind matches.
Trait Implementations§
Source§impl Clone for EvaluationWireEnvelopeV1
impl Clone for EvaluationWireEnvelopeV1
Source§fn clone(&self) -> EvaluationWireEnvelopeV1
fn clone(&self) -> EvaluationWireEnvelopeV1
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EvaluationWireEnvelopeV1
impl Debug for EvaluationWireEnvelopeV1
Source§impl<'de> Deserialize<'de> for EvaluationWireEnvelopeV1
impl<'de> Deserialize<'de> for EvaluationWireEnvelopeV1
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>,
Source§impl PartialEq for EvaluationWireEnvelopeV1
impl PartialEq for EvaluationWireEnvelopeV1
Source§impl Serialize for EvaluationWireEnvelopeV1
impl Serialize for EvaluationWireEnvelopeV1
impl StructuralPartialEq for EvaluationWireEnvelopeV1
Auto Trait Implementations§
impl Freeze for EvaluationWireEnvelopeV1
impl RefUnwindSafe for EvaluationWireEnvelopeV1
impl Send for EvaluationWireEnvelopeV1
impl Sync for EvaluationWireEnvelopeV1
impl Unpin for EvaluationWireEnvelopeV1
impl UnsafeUnpin for EvaluationWireEnvelopeV1
impl UnwindSafe for EvaluationWireEnvelopeV1
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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