pub struct ExternalStateReference { /* private fields */ }Expand description
A bounded reference to a large component-state blob held outside the durable envelope’s inline metadata.
No adapter (S3, Azure, GCS, …) ships with this contract; #144 provides
only the capability/model boundary an adapter would later implement
against.
Implementations§
Source§impl ExternalStateReference
impl ExternalStateReference
Sourcepub const fn new(content_id: ContentIdentity, encoded_len: u64) -> Self
pub const fn new(content_id: ContentIdentity, encoded_len: u64) -> Self
Constructs a bounded external-state reference.
Sourcepub const fn content_id(&self) -> ContentIdentity
pub const fn content_id(&self) -> ContentIdentity
Returns the content identity of the referenced blob.
Sourcepub const fn encoded_len(&self) -> u64
pub const fn encoded_len(&self) -> u64
Returns the declared encoded length of the referenced blob.
Sourcepub fn verify(&self, bytes: &[u8]) -> Result<(), ComponentStateError>
pub fn verify(&self, bytes: &[u8]) -> Result<(), ComponentStateError>
Verifies that resolved bytes match this reference’s declared content identity.
A caller resolving an external reference through an
ExternalStateStore must call this before trusting the resolved
bytes: missing content is ExternalStateError::ContentMissing from
the store itself, while resolved-but-mismatched content is caught
here rather than silently accepted.
§Errors
Returns ComponentStateError::ExternalReferenceContentMismatch when
bytes’s content identity does not match Self::content_id.