Add a little more documentation for Program::info

pull/474/head
Ayrton Sparling 3 years ago
parent 12bf0264a6
commit 830c36ef08

@ -396,7 +396,9 @@ impl Program {
} }
} }
/// Returns ProgramInfo for a program. /// Returns infomation about a program.
///
/// Returns [None](`std::option::Option::None`) when the program does not have a file descriptor (most likely because it isn't loaded).
pub fn info(&self) -> Option<Result<ProgramInfo, ProgramError>> { pub fn info(&self) -> Option<Result<ProgramInfo, ProgramError>> {
match self { match self {
Program::KProbe(p) => p.info(), Program::KProbe(p) => p.info(),
@ -730,6 +732,8 @@ macro_rules! impl_info {
$( $(
impl $struct_name { impl $struct_name {
/// Returns a ProgramInfo for this Program. /// Returns a ProgramInfo for this Program.
///
/// Returns [None](`std::option::Option::None`) when the program does not have a file descriptor (most likely because it isn't loaded).
pub fn info(&self) -> Option<Result<ProgramInfo, ProgramError>> { pub fn info(&self) -> Option<Result<ProgramInfo, ProgramError>> {
self.data.fd.map(|fd| ProgramInfo::from_fd(&fd)) self.data.fd.map(|fd| ProgramInfo::from_fd(&fd))
} }

Loading…
Cancel
Save