-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Session change streams currently don't expose a type that implements Stream the way that session cursors do; ideally they'd have a mirroring interface.
The lack of current implementation is an artifact of the Rust lifetime system:
- wrapping a session cursor stream means iteration in the stream cannot update the underlying session cursor as the stream has an exclusive borrow
- avoiding that by giving an encapsulated future an exclusive borrow prevents state like the resume token from being visible during that borrow
- shifting the state to being reference-counted would require holding that reference across a poll resume point, requiring unsafe code