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
I don't recognize "internal" as being standard Rust terminology. If these methods are intended to be private implementation details of the deepsize crate, implemented and called only from deepsize code, then they should not be rendered in public API documentation.
I agree that they are implementation details, but they are required to be able to implement DeepSizeOf on a struct that uses heap allocation. The problem is that these methods need mutable state to be able to track references, and that has to be passed somehow. These should only be called from within an implementation of the deep_size_of_children function, but they can't be hidden or private because they are needed to be able to implement the trait.
I'm not sure what the best solution to this would be. I might be able to combine or remove one of recurse_deep_size_of and deep_size_of_children to make it more consistent, so that there would only be one implementation method.
I think clarifying what "internal" means (as you did in your response) would be sufficient. It seems likely that a user would read that something is "internal" and understand that to mean they are not supposed to implement it themselves.
Currently two methods of the DeepSizeOf trait are documented as being "internal".
deepsize/src/lib.rs
Lines 80 to 82 in 8c87216
deepsize/src/lib.rs
Lines 92 to 94 in 8c87216
I don't recognize "internal" as being standard Rust terminology. If these methods are intended to be private implementation details of the deepsize crate, implemented and called only from deepsize code, then they should not be rendered in public API documentation.
@Aeledfyr
The text was updated successfully, but these errors were encountered: