#What differentiates the various 'Implementations' section headings on docs.rs?

3 messages · Page 1 of 1 (latest)

peak dock
#

I refer to the sections. "Implementations", "Auto Trait Implementations" seen on docs.rs for most (?) types.

Just to give a concrete example: https://docs.rs/bevy/latest/bevy/ecs/event/struct.EventWriter.html

I can examine the source code and figure out what the "Implementations" section means. That's plenty clear. But when I get to "Trait Implementations" ... does that mean that it just has the right methods to match a trait definition and there's nowhere that's made explicit? Am I missing a helpful piece of tooling that shows that? (I use vanilla emacs + rustic + rust-analyzer)

The subsequent sections I understand even less. Is there a precise definition for these sections and what goes in them? Maybe even just pointing to the code that creates the different headings would be enough of a thread to pull.

paper hearth
#

Implementations are of the form impl Type.

Trait implementations are of the form impl Trait for Type

Auto trait implementations are special traits that are automatically implemented by rust for every type unless you specify impl !Trait for Type

Blanket implementations are of the form impl<T> Trait for T (T can have trait bounds as well)

worthy marlin
#

You can more or less think about them as being listed in order (guessed by rustdoc) of “likelihood of relevance to using this specific type”.