is it possible to have an Rc<dyn Trait>, or is it just Box and & that can do this
-
Show this thread
-
Replying to @mountain_ghosts
Rc works. Anything that's a pointer, practically speaking anything implementing CoerceUnsized
1 reply 0 retweets 1 like -
Replying to @ManishEarth @mountain_ghosts
Unsized types can live behind pointers within other types, it's just constructing these that can be tricky. In the case of Rc it's just a cast
1 reply 0 retweets 0 likes -
Replying to @ManishEarth @mountain_ghosts
You can even do struct Foo { // Bunch of fields last: dyn Bar } and Rc<Foo> will work, it's just annoying to construct
1 reply 0 retweets 0 likes -
-
Replying to @sgrif @mountain_ghosts
everything is possible you just need enough `unsafe`pic.twitter.com/pQyz3cPPrm
1 reply 0 retweets 2 likes
Replying to @ManishEarth @mountain_ghosts
Wait what how
5:53 PM - 27 Jun 2019
1 reply
0 retweets
1 like
-
-
Replying to @sgrif @mountain_ghosts
get the vtable pointer by constructing a fake Box<dyn Foo> and kinda splice it together
0 replies 0 retweets 2 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.