PyO3 / tokio

Asyncio event loop written in Rust language
Other
245 stars 12 forks source link

New python binding implementation #39

Closed fafhrd91 closed 7 years ago

fafhrd91 commented 7 years ago

We now use new python binding https://github.com/PyO3/PyO3 it is based on rust-cpython, but whole class generation has been significantly redesigned now code looks more like rust and not like some kind of python:

#[py:class]
pub struct Socket {
  connected: bool
}

#[py:proto]
impl PyIterProtocol for Socket {
  fn __iter__(&self, py: Python) -> PyResult<PyObject> {
  }
}

#[py:proto]
impl PyAsyncProtocol for Socket {
  fn __await__(&self, py: Python) -> PyResult<PyObject> {
  }
}

most of class functionality of already implemented, everything else should be completed within next week

fafhrd91 commented 7 years ago

all tests pass with pyo3 binding