pub struct ReaderRegion<M> { /* private fields */ }Expand description
Mapping-lifetime owner that can mint acquire-only capabilities.
Implementations§
Source§impl<M: ReadOnlyMapping> ReaderRegion<M>
impl<M: ReadOnlyMapping> ReaderRegion<M>
Sourcepub fn new(
mapping: M,
layout: ValidatedRegionLayout,
topology: RegionSetLayout,
) -> Result<Self, (M, BindingError)>
pub fn new( mapping: M, layout: ValidatedRegionLayout, topology: RegionSetLayout, ) -> Result<Self, (M, BindingError)>
Consumes a platform-minted read-only witness.
On rejection, returns the witness alongside the error so the caller recovers the mapping instead of losing it.
Sourcepub fn slot(&self, slot: u32) -> Result<ReaderSlot<'_>, BindingError>
pub fn slot(&self, slot: u32) -> Result<ReaderSlot<'_>, BindingError>
Binds one checked slot without exposing shared bytes.
Sourcepub fn copy_payload(
&self,
slot: u32,
expected_sequence: u64,
) -> Result<Vec<u8>, BindingError>
pub fn copy_payload( &self, slot: u32, expected_sequence: u64, ) -> Result<Vec<u8>, BindingError>
Copies one bounded hostile payload and rechecks its publication metadata.
Same-sequence malicious mutation can still produce torn bytes; the returned owned buffer must be decoded as hostile input.
Sourcepub fn copy_payload_into(
&self,
slot: u32,
expected_sequence: u64,
destination: &mut [u8],
) -> Result<usize, BindingError>
pub fn copy_payload_into( &self, slot: u32, expected_sequence: u64, destination: &mut [u8], ) -> Result<usize, BindingError>
Copies one bounded hostile payload into caller storage and rechecks its publication metadata, performing no allocation.
Returns the copied payload length. Same-sequence malicious mutation can still produce torn bytes; the destination prefix must be decoded as hostile input. Bytes past the returned length are untouched.
Sourcepub fn into_mapping(self) -> M
pub fn into_mapping(self) -> M
Releases the binding and returns the owned mapping witness.
Sourcepub fn acknowledgement(
&self,
target: RoleId,
slot: u32,
) -> Result<AcknowledgementReader<'_>, BindingError>
pub fn acknowledgement( &self, target: RoleId, slot: u32, ) -> Result<AcknowledgementReader<'_>, BindingError>
Binds one checked acknowledgement route without exposing shared bytes.