[][src]Trait runng::asyncio::AsyncSocket

pub trait AsyncSocket: Socket {
    type ContextType: AsyncContext;
    fn create_async(&self) -> Result<Self::ContextType> { ... }
}

A Socket that can be turned into a context for asynchronous I/O.

Examples

use runng::{
    *,
    asyncio::*,
    factory::latest::ProtocolFactory,
};
fn test() -> runng::Result<()> {
    let factory = ProtocolFactory::default();
    let mut pusher = factory.pusher_open()?;
    let mut push_ctx = pusher.listen("inproc://test")?.create_async()?;
    Ok(())
}

Associated Types

type ContextType: AsyncContext

The type of aynchronous context produced

Loading content...

Provided methods

fn create_async(&self) -> Result<Self::ContextType>

Turns the Socket into an asynchronous context

Loading content...

Implementors

impl AsyncSocket for Bus0[src]

impl AsyncSocket for Pair0[src]

impl AsyncSocket for Pair1[src]

impl AsyncSocket for Pub0[src]

impl AsyncSocket for Pull0[src]

impl AsyncSocket for Push0[src]

impl AsyncSocket for Rep0[src]

impl AsyncSocket for Req0[src]

impl AsyncSocket for Sub0[src]

Loading content...