deepsize
deepsize copied to clipboard
Examples of using Context
Currently none of the example code or documentation shows how to use Context. I would expect to see usage examples on this page:
https://docs.rs/deepsize/0.1.1/deepsize/struct.Context.html
@Aeledfyr
The documentation also currently suggests that Context should become a private type before stabilization. But it can be quite useful to allow for re-using a Context across multiple calls.
For example: I would like to make multiple deep_size_of calls for known roots of an object graph (where objects are likely to contain Arcs sharing content), without those individual deep_size_of calls double-counting shared structure. The end result is still an accurate total, even though it might "blame" some of the deep size to one root rather than another based on the call order.