You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The former defines mutation functions, as well as borrow_mut(&'b mut self) -> CellWriter<'b, F> and borrow(&'b self) -> CellReader<'a, F>. The latter defines read functions as well and is Copyable. Thanks to their lifetime parameters and a careful assignment of Copy / Send / Sync implementations, they could provide the same guarantees as &mut CellOwner<F> and &CellOwner<F> while being zero-sized.
Though &mut CellOwner / &CellOwner (with CellOwner a ZST) can be well optimized, they are nonetheless not zero-sized, so such a change would make borrowing a CellOwner completely free.
The text was updated successfully, but these errors were encountered:
Consider adding:
struct CellWriter<'a, F: Family>(PhantomData<&'a mut ()>)
struct CellReader<'a, F: Family>(PhantomData<&'a ()>)
The former defines mutation functions, as well as
borrow_mut(&'b mut self) -> CellWriter<'b, F>
andborrow(&'b self) -> CellReader<'a, F>
. The latter defines read functions as well and isCopy
able. Thanks to their lifetime parameters and a careful assignment ofCopy
/Send
/Sync
implementations, they could provide the same guarantees as&mut CellOwner<F>
and&CellOwner<F>
while being zero-sized.Though
&mut CellOwner
/&CellOwner
(withCellOwner
a ZST) can be well optimized, they are nonetheless not zero-sized, so such a change would make borrowing aCellOwner
completely free.The text was updated successfully, but these errors were encountered: