interprocess 2.2.2

Interprocess communication toolkit
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::super::uds_local_socket::tokio as uds_impl;
use crate::local_socket::{
	tokio::{prelude::*, Listener, Stream},
	ListenerOptions, Name,
};
use std::io;

#[inline]
pub fn from_options(options: ListenerOptions<'_>) -> io::Result<Listener> {
	options
		.create_tokio_as::<uds_impl::Listener>()
		.map(Listener::from)
}

#[inline]
pub async fn connect(name: Name<'_>) -> io::Result<Stream> {
	uds_impl::Stream::connect(name).await.map(Stream::from)
}