__init__.pxd 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. from libcpp cimport bool as cbool
  2. cdef extern from "folly/ExceptionWrapper.h" namespace "folly":
  3. cdef cppclass cFollyExceptionWrapper "folly::exception_wrapper":
  4. void throw_exception() except +
  5. cdef extern from "folly/Try.h" namespace "folly" nogil:
  6. cdef cppclass cFollyTry "folly::Try"[T]:
  7. T value()
  8. cbool hasException[T]()
  9. cbool hasException()
  10. cFollyExceptionWrapper exception()
  11. cdef extern from "folly/futures/Future.h" namespace "folly" nogil:
  12. cdef cppclass cFollyFuture "folly::Future"[T]:
  13. T get()
  14. cbool hasValue()
  15. #TODO add via and then
  16. cdef extern from "folly/Unit.h" namespace "folly":
  17. struct cFollyUnit "folly::Unit":
  18. pass
  19. cFollyUnit c_unit "folly::unit"
  20. cdef extern from "folly/futures/Promise.h" namespace "folly":
  21. cdef cppclass cFollyPromise "folly::Promise"[T]:
  22. cFollyPromise()
  23. void setValue[M](M& value)
  24. void setException[E](E& value)
  25. cFollyFuture[T] getFuture()
  26. cdef extern from "folly/Executor.h" namespace "folly":
  27. cdef cppclass cFollyExecutor "folly::Executor":
  28. pass