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,
) -> ExternalStateReference
pub const fn new( content_id: ContentIdentity, encoded_len: u64, ) -> ExternalStateReference
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.
Trait Implementations§
Source§impl Clone for ExternalStateReference
impl Clone for ExternalStateReference
Source§fn clone(&self) -> ExternalStateReference
fn clone(&self) -> ExternalStateReference
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ExternalStateReference
Source§impl Debug for ExternalStateReference
impl Debug for ExternalStateReference
impl Eq for ExternalStateReference
Source§impl PartialEq for ExternalStateReference
impl PartialEq for ExternalStateReference
impl StructuralPartialEq for ExternalStateReference
Auto Trait Implementations§
impl Freeze for ExternalStateReference
impl RefUnwindSafe for ExternalStateReference
impl Send for ExternalStateReference
impl Sync for ExternalStateReference
impl Unpin for ExternalStateReference
impl UnsafeUnpin for ExternalStateReference
impl UnwindSafe for ExternalStateReference
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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