I have a question about the documentation created via cargo doc
for a generic struct like this:
#[derive(Debug,Copy,Clone)]
pub struct Bounds3<T> {
pub p_min: Point3<T>,
pub p_max: Point3<T>,
}
I first derived the Default
trait via #[derive(Default]
but later removed Default
from that list and implemented it only for one particular type of the more generic T
type:
pub type Float = f64;
pub type Bounds3f = Bounds3<Float>;
...
impl Default for Bounds3f {
fn default() -> Bounds3f {
let min_num: Float = std::f64::MIN;
let max_num: Float = std::f64::MAX;
Bounds3f {
p_min: Point3f {
x: max_num,
y: max_num,
z: max_num,
}, p_max: Point3f {
x: min_num,
y: min_num,
z: min_num,
},
}
}
}
Here is the resulting documentation:
pbrt - Rust (structs)
https://www.janwalter.org/doc/rust/pbrt/struct.Bounds3.html (generic Bounds3)
What I can't find is where the documentation for fn default() -> Bounds3f
would go. If I derive the trait it is there:
https://www.janwalter.org/doc/rust/pbrt/struct.Bounds2.html
Is this a bug in the documentation system, or is my expectation (to find such a function being documented) wrong?