Why can Pin > directly call Future::poll when it expects Pin
The Rust Programming Language Forum
Why can Pin > directly call Future::poll when it expects Pin
Hi, I recently encountered a Rust behavior regarding Pin and Future that I’d like to clarify. Rust impl Future for TockSubscribe { type Output = Result<(u32, u32, u32), ErrorCode>; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { // ... } } Even though poll takes self: Pin<&mut Self>, the caller holds a Pin<Box<TockSubscribe>> and can still invoke it directly. Why does this work, and what specific Rust rules (such as deref coercion or blanket ...
0 comments
No comments yet.