Struct show_notes::e001::TVShow
source · pub struct TVShow {
pub theme: String,
pub year: i32,
director: String,
}
Expand description
This is a sample structure, to demonstrate rustdoc
/cargo doc
.
All of this will be attached to the structure definition when you see it live on the site. If you need to document members, you can do it inline!
It’s worth taking a look at the source for this: you can see how private and public fields are handled differently in the documentation.
Fields§
§theme: String
Here is a string telling us what the theme song was.
year: i32
Here is the year the show premiered.
director: String
Here is the director—but (s)he’s rather shy and private.
Implementations§
source§impl TVShow
impl TVShow
You can also document the implementation. This is usually not going to be
something you particularly need with a struct
, because you can just
attach the documentation to the struct
itself. However, it is the kind
of thing that could be useful if you are implementing a trait
. (More on
that in a later episode!)