pub struct ActiveReader { /* private fields */ }Expand description
Stable read-only mapping of peer-writable hostile bytes.
Active mappings are uniquely owned and cannot be cloned.
use native_ipc::active::ActiveReader;
fn duplicate(reader: ActiveReader) { let _ = reader.clone(); }use native_ipc::active::ActiveReader;
fn pointer(reader: &ActiveReader) { let _ = unsafe { reader.as_ptr() }; }Implementations§
Source§impl ActiveReader
impl ActiveReader
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Whether the logical payload is empty (always false for valid regions).
Sourcepub fn guard_capability(&self) -> GuardCapability
pub fn guard_capability(&self) -> GuardCapability
Reports the guard policy applied to this endpoint’s own view mapping and whether inaccessible guard bands are actually installed around it.
Guard bands contain in-process linear overruns past this view. They do not constrain the peer’s own address space, and they do not constrain aliases created by a hostile holder of delegated native capability. The receiving endpoint always applies best-effort installation; the creating endpoint applies the policy requested for the region.
Sourcepub fn read_into(
&self,
offset: usize,
destination: &mut [u8],
) -> Result<(), AccessError>
pub fn read_into( &self, offset: usize, destination: &mut [u8], ) -> Result<(), AccessError>
Copies hostile externally mutable bytes into caller-owned storage.
The copy is byte-volatile and may be torn or internally inconsistent. It provides memory safety and bounds checking, not payload integrity.
Sourcepub fn prefault(
&self,
range: Range<usize>,
) -> Result<PrefaultResult, AccessError>
pub fn prefault( &self, range: Range<usize>, ) -> Result<PrefaultResult, AccessError>
Touches one byte per covered page off-thread.
Source§impl ActiveReader
impl ActiveReader
Sourcepub fn bind(
self,
layout: ValidatedRegionLayout,
topology: RegionSetLayout,
) -> Result<ReaderRegion<BoundReadMapping>, Box<BindRejected<ActiveReader>>>
pub fn bind( self, layout: ValidatedRegionLayout, topology: RegionSetLayout, ) -> Result<ReaderRegion<BoundReadMapping>, Box<BindRejected<ActiveReader>>>
Consumes this committed mapping into an audited core read capability.
On rejection the returned BindRejected carries this exact reader back
through BindRejected::into_inner.