Struct aya::programs::ProgramInfo
source · [−]pub struct ProgramInfo(_);
Expand description
Provides information about a loaded program, like name, id and statistics
Implementations
sourceimpl ProgramInfo
impl ProgramInfo
sourcepub fn name(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn name(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
The name of the program as was provided when it was load. This is limited to 16 bytes
sourcepub fn name_as_str(&self) -> Option<&str>
pub fn name_as_str(&self) -> Option<&str>
The name of the program as a &str. If the name was not valid unicode, None is returned
sourcepub fn fd(&self) -> Result<RawFd, ProgramError>
pub fn fd(&self) -> Result<RawFd, ProgramError>
Returns the fd associated with the program.
The returned fd must be closed when no longer needed.
sourcepub fn from_pinned<P: AsRef<Path>>(path: P) -> Result<ProgramInfo, ProgramError>
pub fn from_pinned<P: AsRef<Path>>(path: P) -> Result<ProgramInfo, ProgramError>
Loads a program from a pinned path in bpffs.
Auto Trait Implementations
impl RefUnwindSafe for ProgramInfo
impl Send for ProgramInfo
impl Sync for ProgramInfo
impl Unpin for ProgramInfo
impl UnwindSafe for ProgramInfo
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more