Struct libbpf_rs::btf::types::FuncProto

source ·
pub struct FuncProto<'btf> { /* private fields */ }
Expand description

A function prototype.

See also libbpf docs

Implementations§

source§

impl<'btf> FuncProto<'btf>

source

pub fn is_empty(&self) -> bool

Whether this type has no members

source

pub fn len(&self) -> usize

How many members this FuncProto has

source

pub fn get(&self, index: usize) -> Option<FuncProtoParam<'btf>>

Get a FuncProtoParam at a given index

§Errors

This function returns None when the index is out of bounds.

source

pub fn iter( &'btf self, ) -> impl ExactSizeIterator<Item = FuncProtoParam<'btf>> + 'btf

Returns an iterator over the FuncProtoParam’s of the FuncProto

Methods from Deref<Target = BtfType<'btf>>§

source

pub fn type_id(&self) -> TypeId

This type’s type id.

source

pub fn name(&self) -> Option<&'btf CStr>

This type’s name.

source

pub fn kind(&self) -> BtfKind

This type’s kind.

source

pub fn is_mod(&self) -> bool

Whether this represent’s a modifier.

source

pub fn is_any_enum(&self) -> bool

Whether this represents any kind of enum.

source

pub fn is_core_compat(&self, other: &Self) -> bool

Whether this btf type is core compatible to other.

source

pub fn is_composite(&self) -> bool

Whether this type represents a composite type (struct/union).

source

pub fn next_type(&self) -> Option<Self>

If this type implements ReferencesType, returns the type it references.

source

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.

source

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.

See skip_mods_and_typedefs.

Trait Implementations§

source§

impl<'btf> Debug for FuncProto<'btf>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'btf> Deref for FuncProto<'btf>

§

type Target = BtfType<'btf>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'btf> ReferencesType<'btf> for FuncProto<'btf>

source§

fn referenced_type_id(&self) -> TypeId

The referenced type’s id.
source§

fn referenced_type(&self) -> BtfType<'btf>

The referenced type.
source§

impl<'btf> TryFrom<BtfType<'btf>> for FuncProto<'btf>

§

type Error = BtfType<'btf>

The type returned in the event of a conversion error.
source§

fn try_from(t: BtfType<'btf>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'btf> Freeze for FuncProto<'btf>

§

impl<'btf> RefUnwindSafe for FuncProto<'btf>

§

impl<'btf> !Send for FuncProto<'btf>

§

impl<'btf> !Sync for FuncProto<'btf>

§

impl<'btf> Unpin for FuncProto<'btf>

§

impl<'btf> UnwindSafe for FuncProto<'btf>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.