pub struct DataSec<'btf> { /* private fields */ }
Expand description
An ELF’s data section, such as .data
, .bss
or .rodata
.
See also libbpf docs
Implementations§
Source§impl<'btf> DataSec<'btf>
impl<'btf> DataSec<'btf>
Sourcepub fn get(&self, index: usize) -> Option<VarSecInfo>
pub fn get(&self, index: usize) -> Option<VarSecInfo>
Get a VarSecInfo
at a given index
§Errors
This function returns None
when the index is out of bounds.
Sourcepub fn iter(&'btf self) -> impl ExactSizeIterator<Item = VarSecInfo> + 'btf
pub fn iter(&'btf self) -> impl ExactSizeIterator<Item = VarSecInfo> + 'btf
Returns an iterator over the VarSecInfo
’s of the DataSec
Methods from Deref<Target = BtfType<'btf>>§
Sourcepub fn is_any_enum(&self) -> bool
pub fn is_any_enum(&self) -> bool
Whether this represents any kind of enum.
Sourcepub fn is_core_compat(&self, other: &Self) -> bool
pub fn is_core_compat(&self, other: &Self) -> bool
Whether this btf type is core compatible to other
.
Sourcepub fn is_composite(&self) -> bool
pub fn is_composite(&self) -> bool
Whether this type represents a composite type (struct/union).
Sourcepub fn next_type(&self) -> Option<Self>
pub fn next_type(&self) -> Option<Self>
If this type implements ReferencesType
, returns the type it references.
Sourcepub fn skip_mods_and_typedefs(&self) -> Self
pub fn skip_mods_and_typedefs(&self) -> Self
Given a type, follows the refering type ids until it finds a type that isn’t a modifier or
a BtfKind::Typedef
.
See is_mod.
Sourcepub fn alignment(&self) -> Result<NonZeroUsize>
pub fn alignment(&self) -> Result<NonZeroUsize>
Returns the alignment of this type, if this type points to some modifier or typedef, those will be skipped until the underlying type (with an alignment) is found.
Trait Implementations§
impl<'btf> Copy for DataSec<'btf>
Auto Trait Implementations§
impl<'btf> Freeze for DataSec<'btf>
impl<'btf> RefUnwindSafe for DataSec<'btf>
impl<'btf> !Send for DataSec<'btf>
impl<'btf> !Sync for DataSec<'btf>
impl<'btf> Unpin for DataSec<'btf>
impl<'btf> UnwindSafe for DataSec<'btf>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)