Skip to main content

ActiveReader

Struct ActiveReader 

Source
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

Source

pub const fn len(&self) -> usize

Logical application-visible byte length.

Source

pub const fn is_empty(&self) -> bool

Whether the logical payload is empty (always false for valid regions).

Source

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.

Source

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.

Source

pub fn prefault( &self, range: Range<usize>, ) -> Result<PrefaultResult, AccessError>

Touches one byte per covered page off-thread.

Source§

impl ActiveReader

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.