pub struct ParentChannel { /* private fields */ }Expand description
Parent side of an authenticated bidirectional port-transfer channel.
Implementations§
Source§impl ParentChannel
impl ParentChannel
Source§impl ParentChannel
impl ParentChannel
Sourcepub fn commit_transfers(
&mut self,
writer: PendingTransferredWriter,
reader: PendingTransferredReader,
) -> Result<(WriterRegion<TransferredWriterMapping>, ReaderRegion<TransferredReaderMapping>), MacBindingError>
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 either pending value belongs to another channel or transfer transaction, if READY does not match the exact canonical batch, or if 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
impl Drop for ParentChannel
Auto Trait Implementations§
impl Freeze for ParentChannel
impl RefUnwindSafe for ParentChannel
impl Send for ParentChannel
impl Sync for ParentChannel
impl Unpin for ParentChannel
impl UnsafeUnpin for ParentChannel
impl UnwindSafe for ParentChannel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more