[][src]Struct susy_tokio_ipc::Endpoint

pub struct Endpoint { /* fields omitted */ }

Endpoint for IPC transport

Examples

extern crate tokio;
extern crate futures;
extern crate susy_tokio_ipc;

use susy_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

impl Send for Endpoint

impl Sync for Endpoint

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Erased for T