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
Hi,
I like your patterns very much btw., I needed the Observer Pattern (which doesn't consume like yours) and tried a little but needed one which can have not only have a ConcreteObserver but also AnotherConcreteObserver, which I think fits more to the purpose.
Since I didn't need detaching, I didn't have the identifying problem when detaching, and came up with a version which uses box and dyn, and no partialeq.
I am intermediate in Rust, I'd say, so I explain best with that.
I even tried a little with detach, which I believe you have to kind of first find out if the dyn type matches (don't know how) and then use the partialeq trait on the concrete type like you did. Because I also had trouble with the trait itself, dyn, box, box dyn, &? in trait alone, I stopped here (I don't need detach), and I believe it could be interesting to you.
The text was updated successfully, but these errors were encountered:
Hi,
I like your patterns very much btw., I needed the Observer Pattern (which doesn't consume like yours) and tried a little but needed one which can have not only have a ConcreteObserver but also AnotherConcreteObserver, which I think fits more to the purpose.
Since I didn't need detaching, I didn't have the identifying problem when detaching, and came up with a version which uses box and dyn, and no partialeq.
I am intermediate in Rust, I'd say, so I explain best with that.
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=5115d33f36e98f73611e1b979988d0f4
I even tried a little with detach, which I believe you have to kind of first find out if the dyn type matches (don't know how) and then use the partialeq trait on the concrete type like you did. Because I also had trouble with the trait itself, dyn, box, box dyn, &? in trait alone, I stopped here (I don't need detach), and I believe it could be interesting to you.
The text was updated successfully, but these errors were encountered: