[][src]Struct parity_tokio_ipc::Endpoint

pub struct Endpoint { /* fields omitted */ }

Endpoint for IPC transport

Examples

extern crate tokio;
extern crate futures;
extern crate parity_tokio_ipc;

use parity_tokio_ipc::{Endpoint, dummy_endpoint};
use futures::{future, Future, Stream};

fn main() {
    let runtime = tokio::runtime::Runtime::new()
        .expect("Error creating tokio runtime");
    let handle = runtime.reactor();
    let endpoint = Endpoint::new(dummy_endpoint());
    let server = endpoint.incoming(handle)
        .expect("failed to open up a new pipe/socket")
        .for_each(|(_stream, _remote_id)| {
            println!("Connection received");
            future::ok(())
        })
        .map_err(|err| panic!("Endpoint connection error: {:?}", err));
    // ... run server etc.
}

Methods

impl Endpoint[src]

pub fn incoming(self, handle: &Handle) -> Result<Incoming>[src]

Stream of incoming connections

pub fn set_security_attributes(
    &mut self,
    security_attributes: SecurityAttributes
)
[src]

Set security attributes for the connection

pub fn path(&self) -> &str[src]

Returns the path of the endpoint.

pub fn new(path: String) -> Self[src]

New IPC endpoint at the given path

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T