Skip to content

Commit fe3ded6

Browse files
committed
libbpf-rs: Generate docs for impls on type alias
rustdoc apparently cannot generate docs for methods implemented on a type alias target unless said type alias is exported from the crate. I think it's b/c under the hood rustdoc is using some clever javascript tricks to inline documentation. They do this to avoid HTML bloat for crates with lots of type alises [0]. The upshot of this is now trait impls like `AsFd` are visible in web docs. This is really important, as otherwise it's quite difficult for users to discover these APIs. The downside of this approach is we publically expose implementation structs in docs. It's not a huge deal, as with skeleton it should be fairly obvious what types they should actually interact with. I kinda doubt anyone reads the docs front to back. [0]: rust-lang/rust#116471
1 parent ad9b058 commit fe3ded6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

libbpf-rs/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ pub use crate::map::MapHandle;
115115
pub use crate::map::MapInfo;
116116
pub use crate::map::MapKeyIter;
117117
pub use crate::map::MapMut;
118+
pub use crate::map::MapImpl;
118119
pub use crate::map::MapType;
119120
pub use crate::map::OpenMap;
121+
pub use crate::map::OpenMapImpl;
120122
pub use crate::map::OpenMapMut;
121123
pub use crate::object::AsRawLibbpf;
122124
pub use crate::object::MapIter;
@@ -132,10 +134,12 @@ pub use crate::print::PrintCallback;
132134
pub use crate::print::PrintLevel;
133135
pub use crate::program::Input as ProgramInput;
134136
pub use crate::program::OpenProgram;
137+
pub use crate::program::OpenProgramImpl;
135138
pub use crate::program::OpenProgramMut;
136139
pub use crate::program::Output as ProgramOutput;
137140
pub use crate::program::Program;
138141
pub use crate::program::ProgramAttachType;
142+
pub use crate::program::ProgramImpl;
139143
pub use crate::program::ProgramMut;
140144
pub use crate::program::ProgramType;
141145
pub use crate::program::TracepointOpts;

0 commit comments

Comments
 (0)