pub struct NodeStateUpdate { /* private fields */ }Expand description
Schema-pinned bounded update emitted by one successful node activation.
The graph registry must validate Self::data against Self::schema
before construction. This type independently binds the schema identity and
RFC 8785 data bytes so storage corruption cannot substitute either field.
Implementations§
Source§impl NodeStateUpdate
impl NodeStateUpdate
Sourcepub fn new(
schema: SchemaReference,
data: BoundedJson,
) -> Result<Self, NodeStateUpdateError>
pub fn new( schema: SchemaReference, data: BoundedJson, ) -> Result<Self, NodeStateUpdateError>
Constructs and checksums a validated update.
§Errors
Returns NodeStateUpdateError::Integrity when canonicalization fails.
Sourcepub fn restore(
schema: SchemaReference,
data: BoundedJson,
digest: Digest,
) -> Result<Self, NodeStateUpdateError>
pub fn restore( schema: SchemaReference, data: BoundedJson, digest: Digest, ) -> Result<Self, NodeStateUpdateError>
Restores a durable update and verifies its checksum.
§Errors
Returns NodeStateUpdateError for canonicalization failure or a
mismatched persisted digest.
Sourcepub const fn schema(&self) -> &SchemaReference
pub const fn schema(&self) -> &SchemaReference
Returns the pinned update schema.
Sourcepub const fn data(&self) -> &BoundedJson
pub const fn data(&self) -> &BoundedJson
Returns the bounded update JSON.
Trait Implementations§
Source§impl Clone for NodeStateUpdate
impl Clone for NodeStateUpdate
Source§impl Debug for NodeStateUpdate
impl Debug for NodeStateUpdate
Source§impl<'de> Deserialize<'de> for NodeStateUpdate
impl<'de> Deserialize<'de> for NodeStateUpdate
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 Eq for NodeStateUpdate
Source§impl JsonSchema for NodeStateUpdate
impl JsonSchema for NodeStateUpdate
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for NodeStateUpdate
impl PartialEq for NodeStateUpdate
Source§impl Serialize for NodeStateUpdate
impl Serialize for NodeStateUpdate
impl StructuralPartialEq for NodeStateUpdate
Auto Trait Implementations§
impl Forget for NodeStateUpdate
impl Freeze for NodeStateUpdate
impl Move for NodeStateUpdate
impl RefUnwindSafe for NodeStateUpdate
impl Send for NodeStateUpdate
impl Sync for NodeStateUpdate
impl Unpin for NodeStateUpdate
impl UnsafeUnpin for NodeStateUpdate
impl UnwindSafe for NodeStateUpdate
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