Pinning is a concept in the Rust programming language that requires a piece of data to never be moved from its location in memory. Questions with this tag are about the complexities of the pinning contract, transitioning between pinned references and mutable references, or calling methods on pinned objects. Pinning is closely tied to async in Rust; this tag is not for async-related questions unless the question specifically includes the pinning contract.
Questions tagged [rust-pin]
17 questions
0
votes
0 answers
Different Target for Deref and DerefMut
I am trying to create a wrapper type around a cxx::UniquePtr.
I want to implement struct B(UniquePtr) with
Deref> for B
but also
DerefMut> for B {}
Is this a terrible idea or even possible? The whole…
0
votes
1 answer
How do I pin project an element of a vector?
Following code does not compile because the element pulled from the vector does not implement the Pin<> type.
The error is in ele.poll() call
#[pin_project]
pub struct FifoCompletions
where
F: Future

user855
- 19,048
- 38
- 98
- 162