Struct libbpf_rs::btf::types::Enum64

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

An Enum of 64 bits.

See also libbpf docs

Implementations§

source§

impl<'btf> Enum64<'btf>

source

pub fn is_empty(&self) -> bool

Whether this type has no members

source

pub fn len(&self) -> usize

How many members this Enum64 has

source

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

Get a Enum64Member 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 = Enum64Member<'btf>> + 'btf

Returns an iterator over the Enum64Member’s of the Enum64

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 Enum64<'btf>

source§

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

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

impl<'btf> Deref for Enum64<'btf>

§

type Target = BtfType<'btf>

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl<'btf> HasSize<'btf> for Enum64<'btf>

source§

fn size(&self) -> usize

The size of the described type.
source§

impl<'btf> TryFrom<BtfType<'btf>> for Enum64<'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 Enum64<'btf>

§

impl<'btf> RefUnwindSafe for Enum64<'btf>

§

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

§

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

§

impl<'btf> Unpin for Enum64<'btf>

§

impl<'btf> UnwindSafe for Enum64<'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.