Struct lief::generic::FunctionFlags
pub struct FunctionFlags(/* private fields */);
Expand description
Flags used to characterize the semantics of the function
Implementations§
§impl FunctionFlags
impl FunctionFlags
pub const NONE: Self = _
pub const CONSTRUCTOR: Self = _
pub const CONSTRUCTOR: Self = _
The function acts as constructor.
Usually this flag is associated with functions
that are located in the .init_array
, __mod_init_func
or .tls
sections
pub const DESTRUCTOR: Self = _
pub const DESTRUCTOR: Self = _
The function acts as a destructor.
Usually this flag is associated with functions
that are located in the .fini_array
or __mod_term_func
sections
pub const DEBUG_INFO: Self = _
pub const DEBUG_INFO: Self = _
The function is associated with Debug information
pub const EXPORTED: Self = _
pub const EXPORTED: Self = _
The function is exported by the binary and the Function::address
returns its virtual address in the binary
pub const IMPORTED: Self = _
pub const IMPORTED: Self = _
The function is imported by the binary and the Function::address
should return 0
§impl FunctionFlags
impl FunctionFlags
pub const fn empty() -> Self
pub const fn empty() -> Self
Get a flags value with all bits unset.
pub const fn all() -> Self
pub const fn all() -> Self
Get a flags value with all known bits set.
pub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
pub const fn from_bits(bits: u32) -> Option<Self>
pub const fn from_bits(bits: u32) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
pub const fn from_bits_truncate(bits: u32) -> Self
pub const fn from_bits_truncate(bits: u32) -> Self
Convert from a bits value, unsetting any unknown bits.
pub const fn from_bits_retain(bits: u32) -> Self
pub const fn from_bits_retain(bits: u32) -> Self
Convert from a bits value exactly.
pub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
pub const fn intersects(&self, other: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
pub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
pub fn insert(&mut self, other: Self)
pub fn insert(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
pub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
pub fn toggle(&mut self, other: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
pub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
pub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
pub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
pub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
pub const fn symmetric_difference(self, other: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
pub const fn complement(self) -> Self
pub const fn complement(self) -> Self
The bitwise negation (!
) of the bits in a flags value, truncating the result.
§impl FunctionFlags
impl FunctionFlags
pub const fn iter(&self) -> Iter<FunctionFlags>
pub const fn iter(&self) -> Iter<FunctionFlags>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
pub const fn iter_names(&self) -> IterNames<FunctionFlags>
pub const fn iter_names(&self) -> IterNames<FunctionFlags>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
§impl Binary for FunctionFlags
impl Binary for FunctionFlags
§impl BitAnd<FunctionFlags> for FunctionFlags
impl BitAnd<FunctionFlags> for FunctionFlags
§type Output = FunctionFlags
type Output = FunctionFlags
&
operator.§impl BitAndAssign<FunctionFlags> for FunctionFlags
impl BitAndAssign<FunctionFlags> for FunctionFlags
§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
The bitwise and (&
) of the bits in two flags values.
§impl BitOr<FunctionFlags> for FunctionFlags
impl BitOr<FunctionFlags> for FunctionFlags
§fn bitor(self, other: FunctionFlags) -> Self
fn bitor(self, other: FunctionFlags) -> Self
The bitwise or (|
) of the bits in two flags values.
§type Output = FunctionFlags
type Output = FunctionFlags
|
operator.§impl BitOrAssign<FunctionFlags> for FunctionFlags
impl BitOrAssign<FunctionFlags> for FunctionFlags
§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
The bitwise or (|
) of the bits in two flags values.
§impl BitXor<FunctionFlags> for FunctionFlags
impl BitXor<FunctionFlags> for FunctionFlags
§type Output = FunctionFlags
type Output = FunctionFlags
^
operator.§impl BitXorAssign<FunctionFlags> for FunctionFlags
impl BitXorAssign<FunctionFlags> for FunctionFlags
§fn bitxor_assign(&mut self, other: Self)
fn bitxor_assign(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
§impl Clone for FunctionFlags
impl Clone for FunctionFlags
§fn clone(&self) -> FunctionFlags
fn clone(&self) -> FunctionFlags
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for FunctionFlags
impl Debug for FunctionFlags
§impl Display for FunctionFlags
impl Display for FunctionFlags
§impl Extend<FunctionFlags> for FunctionFlags
impl Extend<FunctionFlags> for FunctionFlags
§fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
The bitwise or (|
) of the bits in each flags value.
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)§impl Flags for FunctionFlags
impl Flags for FunctionFlags
§const FLAGS: &'static [Flag<FunctionFlags>] = _
const FLAGS: &'static [Flag<FunctionFlags>] = _
§fn from_bits_retain(bits: u32) -> FunctionFlags
fn from_bits_retain(bits: u32) -> FunctionFlags
§fn contains_unknown_bits(&self) -> bool
fn contains_unknown_bits(&self) -> bool
true
if any unknown bits are set.§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere Self: Sized,
§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere Self: Sized,
§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where Self: Sized,
|
) of the bits in two flags values.§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where Self: Sized,
&!
). Read more§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where Self: Sized,
^
) of the bits in two flags values.§fn set(&mut self, other: Self, value: bool)where
Self: Sized,
fn set(&mut self, other: Self, value: bool)where Self: Sized,
Flags::insert
] when value
is true
or [Flags::remove
] when value
is false
.§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read more§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.§impl From<FunctionFlags> for u32
impl From<FunctionFlags> for u32
§fn from(value: FunctionFlags) -> Self
fn from(value: FunctionFlags) -> Self
§impl From<u32> for FunctionFlags
impl From<u32> for FunctionFlags
§impl FromIterator<FunctionFlags> for FunctionFlags
impl FromIterator<FunctionFlags> for FunctionFlags
§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
§impl Hash for FunctionFlags
impl Hash for FunctionFlags
§impl IntoIterator for FunctionFlags
impl IntoIterator for FunctionFlags
§type Item = FunctionFlags
type Item = FunctionFlags
§type IntoIter = Iter<FunctionFlags>
type IntoIter = Iter<FunctionFlags>
§impl LowerHex for FunctionFlags
impl LowerHex for FunctionFlags
§impl Not for FunctionFlags
impl Not for FunctionFlags
§type Output = FunctionFlags
type Output = FunctionFlags
!
operator.§impl Octal for FunctionFlags
impl Octal for FunctionFlags
§impl Ord for FunctionFlags
impl Ord for FunctionFlags
§impl PartialEq<FunctionFlags> for FunctionFlags
impl PartialEq<FunctionFlags> for FunctionFlags
§fn eq(&self, other: &FunctionFlags) -> bool
fn eq(&self, other: &FunctionFlags) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd<FunctionFlags> for FunctionFlags
impl PartialOrd<FunctionFlags> for FunctionFlags
§fn partial_cmp(&self, other: &FunctionFlags) -> Option<Ordering>
fn partial_cmp(&self, other: &FunctionFlags) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl PublicFlags for FunctionFlags
impl PublicFlags for FunctionFlags
§impl Sub<FunctionFlags> for FunctionFlags
impl Sub<FunctionFlags> for FunctionFlags
§fn sub(self, other: Self) -> Self
fn sub(self, other: Self) -> Self
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
§type Output = FunctionFlags
type Output = FunctionFlags
-
operator.§impl SubAssign<FunctionFlags> for FunctionFlags
impl SubAssign<FunctionFlags> for FunctionFlags
§fn sub_assign(&mut self, other: Self)
fn sub_assign(&mut self, other: Self)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.