Skip to main content

ActiveWriter

Struct ActiveWriter 

Source
pub struct ActiveWriter { /* private fields */ }
Expand description

Stable sole-writer mapping. It is movable between threads but deliberately not shareable between threads.

use native_ipc::active::ActiveWriter;
fn assert_sync<T: Sync>() {}
assert_sync::<ActiveWriter>();

Implementations§

Source§

impl ActiveWriter

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 write_from( &mut self, offset: usize, source: &[u8], ) -> Result<(), AccessError>

Copies caller bytes into the sole writable mapping.

Source

pub fn fill( &mut self, range: Range<usize>, value: u8, ) -> Result<(), AccessError>

Fills a checked logical range with one byte value.

Source

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

Touches one byte per covered page off-thread without changing contents.

Source§

impl ActiveWriter

Source

pub fn bind( self, layout: ValidatedRegionLayout, topology: RegionSetLayout, ) -> Result<WriterRegion<BoundWriteMapping>, Box<BindRejected<ActiveWriter>>>

Consumes this committed mapping into an audited core write capability.

On rejection the returned BindRejected carries this exact writer 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.