And I have to add that I'm able to use it but then 'static lifetime is been auto propagated from somewhere and that causes issues with pin_project_lite::project() as it's used inside Future impl as Output type.
I guess that's the main question but brain is melting a bit...
If I use async_std::io::ErorKind::WriteZero.into() and async_std::io::Result<()> as Output everything works fine but I dont have custom errors anymore.
error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> src/processor/async_processing.rs:41:37
|
40 | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
| -------------- this data with an anonymous lifetime `'_`...
41 | let mut this = self.project();
| ^^^^^^^ ...is captured here, requiring it to live as long as `'static`
error: aborting due to previous error
I tried compiling it myself, but got a bunch of errors from the signatures dependency. Did the error include any sort of help message that you cut out?
Well it sounds like something somewhere is requiring something that derives from this to be 'static, but the error doesn't say what, and I can't run it myself, so I don't think there's much else I am able to do.
Changing Output type to pub type Result<T> = std::result::Result<T, String>; and calling .map_err(|e| e.to_string())? fixes the issue, so it's definitly something with Error enum's lifetime...