Skip to main content

ParentChannel

Struct ParentChannel 

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

Parent side of an authenticated bidirectional port-transfer channel.

Implementations§

Source§

impl ParentChannel

Source

pub const fn peer_pid(&self) -> u32

Kernel-authenticated helper PID.

Source

pub fn wait(self) -> Result<(), BootstrapError>

Waits for normal helper exit and consumes the child cleanup ledger.

Source§

impl ParentChannel

Source

pub fn commit_transfers( &mut self, writer: PendingTransferredWriter, reader: PendingTransferredReader, ) -> Result<(WriterRegion<TransferredWriterMapping>, ReaderRegion<TransferredReaderMapping>), MacBindingError>

Consumes a complete two-region transfer, waits for peer validation, then sends COMMIT before exposing either local runtime capability.

§Errors

Returns an error if READY does not match the exact canonical batch or COMMIT cannot be sent unambiguously. The helper is terminated on failure.

use native_ipc_platform::macos::{
    PendingTransferredReader, PendingTransferredWriter, bootstrap::ParentChannel,
};
fn commit_twice(
    channel: &mut ParentChannel,
    writer: PendingTransferredWriter,
    reader: PendingTransferredReader,
) {
    let _ = channel.commit_transfers(writer, reader);
    let _ = channel.commit_transfers(writer, reader);
}
Examples found in repository?
examples/ready_commit.rs (line 51)
36fn creator(
37    channel: &mut native_ipc_platform::macos::bootstrap::ParentChannel,
38    writer: native_ipc_platform::macos::PendingTransferredWriter,
39    reader: native_ipc_platform::macos::PendingTransferredReader,
40) -> Result<
41    (
42        native_ipc_core::mapping::WriterRegion<
43            native_ipc_platform::macos::TransferredWriterMapping,
44        >,
45        native_ipc_core::mapping::ReaderRegion<
46            native_ipc_platform::macos::TransferredReaderMapping,
47        >,
48    ),
49    native_ipc_platform::macos::MacBindingError,
50> {
51    channel.commit_transfers(writer, reader)
52}

Trait Implementations§

Source§

impl Drop for ParentChannel

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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, 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.