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
Today, SwarmEvent is essentially a super-set of FromSwarm. This super-set is however not expressed in the type-system which leads to inconsistencies as described in #4251.
We can fix this by expressing SwarmEvent as a composition of FromSwarm and ToSwarm (a type parameter that will be filled in by NetworkBehaviour::ToSwarm.
As far as I know, the only thing that is blocking this is #3046 which is "just" waiting for the next round of breaking changes.
The text was updated successfully, but these errors were encountered:
There is another thing we need to figure out: FromSwarm currently has a lifetime to make it cheap to the event to the behaviour tree. But all the data in the current SwarmEvent variants is owned!
If we want to reuse FromSwarm within SwarmEvent, I think we'll have to have some kind of Bow (BorrowedOrOwned) type that doesn't impose ToOwned because some of the error types in FromSwarm don't implement that.
Generally, it does seem to be a bit of a mis-match. Within NetworkBehaviour, we will always have borrowed data and within SwarmEvent, it will always be owned ...
Description
Today,
SwarmEvent
is essentially a super-set ofFromSwarm
. This super-set is however not expressed in the type-system which leads to inconsistencies as described in #4251.We can fix this by expressing
SwarmEvent
as a composition ofFromSwarm
andToSwarm
(a type parameter that will be filled in byNetworkBehaviour::ToSwarm
.As far as I know, the only thing that is blocking this is #3046 which is "just" waiting for the next round of breaking changes.
The text was updated successfully, but these errors were encountered: