Description
We currently have the unstable new arrow syntax (<-
) for placement-in in nightly with intention to see how people like the syntax/how ergonomic it is/etc. However, it is pretty hard to try the syntax out without having any useful/common data-structures implementing the placement-in protocol and thus it is pretty unlikely for us to collect much feedback on the syntax.
The Placer
, Place
and InPlace
traits should be implemented for following data structures as appropriate:
- Vec (
&mut myvec <- value
; see this RFC regarding mutable reference) Implement placement-in protocol forVec
#32366 - HashMap through Entry (i.e.
mymap.entry(k) <- value
) Implement placement-in protocol forHashMap
#40390 - BTreeMap through Entry.
- LinkedList Implement placement-in protocol for
LinkedList
#31696 - BinaryHeap (
&mut heap <- value
) Implement placement-in protocol forBinaryHeap
#39062 - VecDeque (
front_place
andback_place
, likeLinkedList
) Implement placement-in protocol forVecDeque
#40389
It should also be investigated how viable implementing placement protocol is for other std::collections
collections and possibly implementing these as well.
Since both placement protocol and placement-in syntax are unstable, there’s no stability hazard.
cc @pnkfelix.
I personally feel this issue has tons of potential to help people get acquainted with rust’s standard library (i.e. is in E-easy land) and would be willing to answer any questions (E-mentor) regarding implementation strategies on IRC or the issue itself.