Struct NamedMessageChannel

Source
pub struct NamedMessageChannel<T, R>
where T: Serialize, R: for<'de> Deserialize<'de>,
{ /* private fields */ }
Expand description

A channel which can be established by sending an automatically generated unique name to another process.

§Security

It depends by platforms, but generally at the very least any other process running under the same user will be able to open this channel instead of the desired process. This method is also not suitable for cooperative processes running with diminished permissions. It is best to send channels to child processes at creation, and to negotiate any further channels over those initial ones. The two sides of a PreMessageChannel can be sent freely over a network of parent-child channels if need be.

Implementations§

Source§

impl<T, R> NamedMessageChannel<T, R>
where T: Serialize, R: for<'de> Deserialize<'de>,

Source

pub fn new(tokio_loop: &TokioHandle, max_message_size: usize) -> Result<Self>

Source

pub fn name(&self) -> &OsStr

Source

pub fn accept(self, timeout: Option<Duration>) -> Result<MessageChannel<T, R>>

Source

pub fn connect<N>( name: N, timeout: Option<Duration>, tokio_loop: &TokioHandle, max_message_size: usize, ) -> Result<MessageChannel<T, R>>
where N: AsRef<OsStr>,

Auto Trait Implementations§

§

impl<T, R> Freeze for NamedMessageChannel<T, R>

§

impl<T, R> !RefUnwindSafe for NamedMessageChannel<T, R>

§

impl<T, R> Send for NamedMessageChannel<T, R>
where T: Send, R: Send,

§

impl<T, R> Sync for NamedMessageChannel<T, R>
where T: Sync, R: Sync,

§

impl<T, R> Unpin for NamedMessageChannel<T, R>
where T: Unpin, R: Unpin,

§

impl<T, R> !UnwindSafe for NamedMessageChannel<T, R>

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.