Struct tetsy_tokio_ipc::Endpoint[][src]

pub struct Endpoint { /* fields omitted */ }

Endpoint for IPC transport

Examples

extern crate tokio;
extern crate futures;
extern crate tetsy_tokio_ipc;

use tetsy_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.
}

Implementations

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 RefUnwindSafe for Endpoint

impl Send for Endpoint

impl !Sync for Endpoint

impl Unpin for Endpoint

impl UnwindSafe for Endpoint

Blanket Implementations

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,