1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! A public module that is only included in the crate with features `foo` and `bar`.

/// A public struct that is always included in the crate.
/// (if the parent module is)
pub struct FooBar {
    /// A public field that is always included in the crate.
    /// (if the parent module is)
    pub foobar: u8,
}

/// A public function that is always included in the crate.
/// (if the parent module is)
pub fn foobar() {
}

/// A public trait that is always included in the crate.
/// (if the parent module is)
pub trait FooBarTrait {
    /// A trait method that is always included in the crate.
    /// (if the parent trait is)
    fn foobar(&self) {
    }
}

impl FooBar {
    /// A public method that is always included in the crate.
    /// (if the parent module is)
    pub fn foobar(&self) {
    }
}

/// A trait impl that is always included in the crate.
/// (if the parent module is)
impl FooBarTrait for FooBar {
    /// A trait method impl that is always included in the crate.
    /// (if the parent trait is)
    fn foobar(&self) {
    }
}