pub struct Btf<'source> { /* private fields */ }
Expand description
The btf information of a bpf object.
The lifetime bound protects against this object outliving its source. This can happen when it
was derived from an Object
, which owns the data this structs points too. When
instead the Btf::from_path
method is used, the lifetime will be 'static
since it doesn’t
borrow from anything.
Implementations§
source§impl<'btf> Btf<'btf>
impl<'btf> Btf<'btf>
sourcepub fn from_raw(
name: &'btf str,
object_file: &'btf [u8]
) -> Result<Option<Self>>
pub fn from_raw( name: &'btf str, object_file: &'btf [u8] ) -> Result<Option<Self>>
From raw bytes coming from an object file.
sourcepub fn ptr_size(&self) -> Result<NonZeroUsize>
pub fn ptr_size(&self) -> Result<NonZeroUsize>
The btf pointer size.
sourcepub fn type_by_id<'s, K>(&'s self, type_id: TypeId) -> Option<K>where
K: TryFrom<BtfType<'s>>,
pub fn type_by_id<'s, K>(&'s self, type_id: TypeId) -> Option<K>where K: TryFrom<BtfType<'s>>,
Find a type by it’s TypeId.
sourcepub fn type_by_kind<'s, K>(&'s self) -> impl Iterator<Item = K> + 'swhere
K: TryFrom<BtfType<'s>>,
pub fn type_by_kind<'s, K>(&'s self) -> impl Iterator<Item = K> + 'swhere K: TryFrom<BtfType<'s>>,
Find all types of a specific type kind.
Trait Implementations§
Auto Trait Implementations§
impl<'source> RefUnwindSafe for Btf<'source>
impl<'source> !Send for Btf<'source>
impl<'source> !Sync for Btf<'source>
impl<'source> Unpin for Btf<'source>
impl<'source> UnwindSafe for Btf<'source>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more