Enum bpf_rs::ProgramType
source · [−]#[non_exhaustive]
#[repr(u32)]
pub enum ProgramType {
Show 32 variants
Unspec,
SocketFilter,
Kprobe,
SchedCls,
SchedAct,
Tracepoint,
Xdp,
PerfEvent,
CgroupSkb,
CgroupSock,
LwtIn,
LwtOut,
LwtXmit,
SockOps,
SkSkb,
CgroupDevice,
SkMsg,
RawTracepoint,
CgroupSockAddr,
LwtSeg6local,
LircMode2,
SkReuseport,
FlowDissector,
CgroupSysctl,
RawTracepointWritable,
CgroupSockopt,
Tracing,
StructOps,
Ext,
Lsm,
SkLookup,
Syscall,
}
Expand description
Must abide by enum bpf_prog_type in kernel headers
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unspec
SocketFilter
Kprobe
SchedCls
SchedAct
Tracepoint
Xdp
PerfEvent
CgroupSkb
CgroupSock
LwtIn
LwtOut
LwtXmit
SockOps
SkSkb
CgroupDevice
SkMsg
RawTracepoint
CgroupSockAddr
LwtSeg6local
LircMode2
SkReuseport
FlowDissector
CgroupSysctl
RawTracepointWritable
CgroupSockopt
Tracing
StructOps
Ext
Lsm
SkLookup
Syscall
Implementations
sourceimpl ProgramType
impl ProgramType
pub fn name(&self) -> &'static str
pub fn probe(&self) -> Result<bool, Error>
sourcepub fn probe_helper(&self, helper: BpfHelper) -> Result<bool, Error>
pub fn probe_helper(&self, helper: BpfHelper) -> Result<bool, Error>
May return true for unsupported program types
sourcepub fn iter() -> impl Iterator<Item = ProgramType>
pub fn iter() -> impl Iterator<Item = ProgramType>
Skips BPF_PROGRAM_TYPE_UNSPEC since it’s an invalid program type
Trait Implementations
sourceimpl Clone for ProgramType
impl Clone for ProgramType
sourcefn clone(&self) -> ProgramType
fn clone(&self) -> ProgramType
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ProgramType
impl Debug for ProgramType
sourceimpl Display for ProgramType
impl Display for ProgramType
sourceimpl From<ProgramType> for u32
impl From<ProgramType> for u32
sourcefn from(enum_value: ProgramType) -> Self
fn from(enum_value: ProgramType) -> Self
Converts to this type from the input type.
sourceimpl Hash for ProgramType
impl Hash for ProgramType
sourceimpl PartialEq<ProgramType> for ProgramType
impl PartialEq<ProgramType> for ProgramType
sourceimpl TryFrom<u32> for ProgramType
impl TryFrom<u32> for ProgramType
type Error = TryFromPrimitiveError<ProgramType>
type Error = TryFromPrimitiveError<ProgramType>
The type returned in the event of a conversion error.
sourcefn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
fn try_from(number: u32) -> Result<Self, TryFromPrimitiveError<Self>>
Performs the conversion.
sourceimpl TryFromPrimitive for ProgramType
impl TryFromPrimitive for ProgramType
type Primitive = u32
const NAME: &'static str = "ProgramType"
fn try_from_primitive(
number: Self::Primitive
) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for ProgramType
impl Eq for ProgramType
impl StructuralEq for ProgramType
impl StructuralPartialEq for ProgramType
Auto Trait Implementations
impl RefUnwindSafe for ProgramType
impl Send for ProgramType
impl Sync for ProgramType
impl Unpin for ProgramType
impl UnwindSafe for ProgramType
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more