Struct PreRawMessageChannel

Source
pub struct PreRawMessageChannel(/* private fields */);
Expand description

A sendable handle for establishing RawMessageChannels with processes you can already communicate with.

PreRawMessageChannels are created in pairs, and then can be freely sent along any IPC method in this crate capable of transmitting OS resources. When they reach their destination they can be converted into RawMessageChannels.

Implementations§

Source§

impl PreRawMessageChannel

Source

pub fn pair() -> Result<(Self, Self)>

Source

pub fn into_raw_channel( self, remote_process: ProcessHandle, tokio_loop: &TokioHandle, ) -> Result<RawMessageChannel>

Creates a RawMessageChannel from a transmitted pre-channel and a remote process handle.

§Security

You should only allow more trusted processes to hold unsealed channels to less trusted processes. On some platforms unsealed channels allow the holder to interfere with the other process.

Using an incorrect remote process handle may cause this function to fail or transmission of OS resources (files, sockets, etc.) accross the channel to fail.

Source

pub fn into_sealed_raw_channel( self, tokio_loop: &TokioHandle, ) -> Result<RawMessageChannel>

Creates a sealed RawMessageChannel from a transmitted pre-channel.

Sealed channels cannot transmit OS resources (files, sockets, etc.) but can still transmit data (they may receive OS resources if the other side is unsealed). It is recommended that you use a sealed channel handle when communicating from the less trusted side of a channel.

Trait Implementations§

Source§

impl Debug for PreRawMessageChannel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PreRawMessageChannel

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PreRawMessageChannel

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,