pub struct ControlObjectEnvelope<T> {
pub kind: ControlObjectKind,
pub format_version: u32,
pub payload_checksum: String,
pub state: T,
}Expand description
In-memory view of a control object envelope.
This struct is not the durable layout; durable bytes are produced only by
encode_control_object and validated only by decode_control_object.
Fields§
§kind: ControlObjectKindDurable-family discriminator that selects T and its independent version.
format_version: u32Family-local format version obtained from kind.
payload_checksum: StringDigest of the payload JSON exactly as stored in the durable document,
in sha256:<hex> form.
state: TDecoded control state protected by payload_checksum.
Implementations§
Source§impl<T> ControlObjectEnvelope<T>where
T: Serialize,
impl<T> ControlObjectEnvelope<T>where
T: Serialize,
Sourcepub fn from_state(
kind: ControlObjectKind,
state: T,
) -> Result<Self, EnvelopeCodecError>
pub fn from_state( kind: ControlObjectKind, state: T, ) -> Result<Self, EnvelopeCodecError>
Builds a family-versioned envelope and computes its checksum from canonical state JSON.
Construction fails when state cannot be encoded.
Trait Implementations§
Source§impl<T: Clone> Clone for ControlObjectEnvelope<T>
impl<T: Clone> Clone for ControlObjectEnvelope<T>
Source§fn clone(&self) -> ControlObjectEnvelope<T>
fn clone(&self) -> ControlObjectEnvelope<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug> Debug for ControlObjectEnvelope<T>
impl<T: Debug> Debug for ControlObjectEnvelope<T>
Source§impl<'de, T> Deserialize<'de> for ControlObjectEnvelope<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ControlObjectEnvelope<T>where
T: Deserialize<'de>,
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
impl<T: Eq> Eq for ControlObjectEnvelope<T>
Source§impl<T: PartialEq> PartialEq for ControlObjectEnvelope<T>
impl<T: PartialEq> PartialEq for ControlObjectEnvelope<T>
Source§impl<T> Serialize for ControlObjectEnvelope<T>where
T: Serialize,
impl<T> Serialize for ControlObjectEnvelope<T>where
T: Serialize,
impl<T: PartialEq> StructuralPartialEq for ControlObjectEnvelope<T>
Auto Trait Implementations§
impl<T> Freeze for ControlObjectEnvelope<T>where
T: Freeze,
impl<T> RefUnwindSafe for ControlObjectEnvelope<T>where
T: RefUnwindSafe,
impl<T> Send for ControlObjectEnvelope<T>where
T: Send,
impl<T> Sync for ControlObjectEnvelope<T>where
T: Sync,
impl<T> Unpin for ControlObjectEnvelope<T>where
T: Unpin,
impl<T> UnsafeUnpin for ControlObjectEnvelope<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for ControlObjectEnvelope<T>where
T: UnwindSafe,
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