pub fn with_memory_pool<I: IoStream>(io: I, pool: PoolRef) -> Self {
        let inner = Rc::new(IoState {
            pool: Cell::new(pool),
            flags: Cell::new(Flags::empty()),
            error: Cell::new(None),
            disconnect_timeout: Cell::new(Millis::ONE_SEC),
            dispatch_task: LocalWaker::new(),
            read_task: LocalWaker::new(),
            write_task: LocalWaker::new(),
            read_buf: Cell::new(None),
            write_buf: Cell::new(None),
            filter: Cell::new(NullFilter::get()),
            handle: Cell::new(None),
            on_disconnect: Cell::new(None),
            keepalive: Cell::new(now()),
        });

        let filter = Box::new(Base::new(IoRef(inner.clone())));
        let filter_ref: &'static dyn Filter = unsafe {
            let filter: &dyn Filter = filter.as_ref();
            std::mem::transmute(filter)
        };
        inner.filter.replace(filter_ref);

        let io_ref = IoRef(inner);

        // start io tasks
        let hnd = io.start(ReadContext::new(&io_ref), WriteContext::new(&io_ref));
        io_ref.0.handle.set(hnd);

        Io(io_ref, FilterItem::with_filter(filter))
    }
/// Create `Io` instance in specific memory pool.
Create `Io` instance in specific memory pool.
Create ` Io ` instance in specific memory pool .
pub fn with_memory_pool<I: IoStream>(io: I, pool: PoolRef) -> Self {
        let inner = Rc::new(IoState {
            pool: Cell::new(pool),
            flags: Cell::new(Flags::empty()),
            error: Cell::new(None),
            disconnect_timeout: Cell::new(Millis::ONE_SEC),
            dispatch_task: LocalWaker::new(),
            read_task: LocalWaker::new(),
            write_task: LocalWaker::new(),
            read_buf: Cell::new(None),
            write_buf: Cell::new(None),
            filter: Cell::new(NullFilter::get()),
            handle: Cell::new(None),
            on_disconnect: Cell::new(None),
            keepalive: Cell::new(now()),
        });
        let filter = Box::new(Base::new(IoRef(inner.clone())));
        let filter_ref: &'static dyn Filter = unsafe {
            let filter: &dyn Filter = filter.as_ref();
            std::mem::transmute(filter)
        };
        inner.filter.replace(filter_ref);
        let io_ref = IoRef(inner);
        // start io tasks
        let hnd = io.start(ReadContext::new(&io_ref), WriteContext::new(&io_ref));
        io_ref.0.handle.set(hnd);
        Io(io_ref, FilterItem::with_filter(filter))
    }
pub fn with_memory_pool < I : IoStream > ( io : I , pool : PoolRef ) -> Self { let inner = Rc :: new ( IoState { pool : Cell :: new ( pool ) , flags : Cell :: new ( Flags :: empty ( ) ) , error : Cell :: new ( None ) , disconnect_timeout : Cell :: new ( Millis :: ONE_SEC ) , dispatch_task : LocalWaker :: new ( ) , read_task : LocalWaker :: new ( ) , write_task : LocalWaker :: new ( ) , read_buf : Cell :: new ( None ) , write_buf : Cell :: new ( None ) , filter : Cell :: new ( NullFilter :: get ( ) ) , handle : Cell :: new ( None ) , on_disconnect : Cell :: new ( None ) , keepalive : Cell :: new ( now ( ) ) , } ) ; let filter = Box :: new ( Base :: new ( IoRef ( inner . clone ( ) ) ) ) ; let filter_ref : & ' static dyn Filter = unsafe { let filter : & dyn Filter = filter . as_ref ( ) ; std :: mem :: transmute ( filter ) } ; inner . filter . replace ( filter_ref ) ; let io_ref = IoRef ( inner ) ; // start io tasks let hnd = io . start ( ReadContext :: new ( & io_ref ) , WriteContext :: new ( & io_ref ) ) ; io_ref . 0 . handle . set ( hnd ) ; Io ( io_ref , FilterItem :: with_filter ( filter ) ) }
Create `Io` instance in specific memory pool.
Create ` Io ` instance in specific memory pool .
io
I
pool
PoolRef
io
I
pool
PoolRef