pub struct DebugLevel { /* private fields */ }
Expand description
Bitflags to activate different levels of debugging inside libmtp
, multiple levels
are activated by using a bitwise or.
§Example
use libmtp_rs::internals::DebugLevel;
let debug_level = DebugLevel::USB | DebugLevel::PTP | DebugLevel::DATA;
Implementations§
Source§impl DebugLevel
impl DebugLevel
pub const NONE: DebugLevel
pub const PTP: DebugLevel
pub const PLST: DebugLevel
pub const USB: DebugLevel
pub const DATA: DebugLevel
pub const ALL: DebugLevel
Sourcepub const fn empty() -> DebugLevel
pub const fn empty() -> DebugLevel
Returns an empty set of flags
Sourcepub const fn all() -> DebugLevel
pub const fn all() -> DebugLevel
Returns the set containing all flags.
Sourcepub fn from_bits(bits: i32) -> Option<DebugLevel>
pub fn from_bits(bits: i32) -> Option<DebugLevel>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: i32) -> DebugLevel
pub const fn from_bits_truncate(bits: i32) -> DebugLevel
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: i32) -> DebugLevel
pub const unsafe fn from_bits_unchecked(bits: i32) -> DebugLevel
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: DebugLevel) -> bool
pub const fn intersects(&self, other: DebugLevel) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: DebugLevel) -> bool
pub const fn contains(&self, other: DebugLevel) -> bool
Returns true
all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: DebugLevel)
pub fn insert(&mut self, other: DebugLevel)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: DebugLevel)
pub fn remove(&mut self, other: DebugLevel)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: DebugLevel)
pub fn toggle(&mut self, other: DebugLevel)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: DebugLevel, value: bool)
pub fn set(&mut self, other: DebugLevel, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
Source§impl Binary for DebugLevel
impl Binary for DebugLevel
Source§impl BitAnd for DebugLevel
impl BitAnd for DebugLevel
Source§fn bitand(self, other: DebugLevel) -> DebugLevel
fn bitand(self, other: DebugLevel) -> DebugLevel
Returns the intersection between the two sets of flags.
Source§type Output = DebugLevel
type Output = DebugLevel
&
operator.Source§impl BitAndAssign for DebugLevel
impl BitAndAssign for DebugLevel
Source§fn bitand_assign(&mut self, other: DebugLevel)
fn bitand_assign(&mut self, other: DebugLevel)
Disables all flags disabled in the set.
Source§impl BitOr for DebugLevel
impl BitOr for DebugLevel
Source§fn bitor(self, other: DebugLevel) -> DebugLevel
fn bitor(self, other: DebugLevel) -> DebugLevel
Returns the union of the two sets of flags.
Source§type Output = DebugLevel
type Output = DebugLevel
|
operator.Source§impl BitOrAssign for DebugLevel
impl BitOrAssign for DebugLevel
Source§fn bitor_assign(&mut self, other: DebugLevel)
fn bitor_assign(&mut self, other: DebugLevel)
Adds the set of flags.
Source§impl BitXor for DebugLevel
impl BitXor for DebugLevel
Source§fn bitxor(self, other: DebugLevel) -> DebugLevel
fn bitxor(self, other: DebugLevel) -> DebugLevel
Returns the left flags, but with all the right flags toggled.
Source§type Output = DebugLevel
type Output = DebugLevel
^
operator.Source§impl BitXorAssign for DebugLevel
impl BitXorAssign for DebugLevel
Source§fn bitxor_assign(&mut self, other: DebugLevel)
fn bitxor_assign(&mut self, other: DebugLevel)
Toggles the set of flags.
Source§impl Clone for DebugLevel
impl Clone for DebugLevel
Source§fn clone(&self) -> DebugLevel
fn clone(&self) -> DebugLevel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DebugLevel
impl Debug for DebugLevel
Source§impl Extend<DebugLevel> for DebugLevel
impl Extend<DebugLevel> for DebugLevel
Source§fn extend<T: IntoIterator<Item = DebugLevel>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = DebugLevel>>(&mut self, iterator: T)
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
)Source§impl FromIterator<DebugLevel> for DebugLevel
impl FromIterator<DebugLevel> for DebugLevel
Source§fn from_iter<T: IntoIterator<Item = DebugLevel>>(iterator: T) -> DebugLevel
fn from_iter<T: IntoIterator<Item = DebugLevel>>(iterator: T) -> DebugLevel
Source§impl Hash for DebugLevel
impl Hash for DebugLevel
Source§impl LowerHex for DebugLevel
impl LowerHex for DebugLevel
Source§impl Not for DebugLevel
impl Not for DebugLevel
Source§fn not(self) -> DebugLevel
fn not(self) -> DebugLevel
Returns the complement of this set of flags.
Source§type Output = DebugLevel
type Output = DebugLevel
!
operator.Source§impl Octal for DebugLevel
impl Octal for DebugLevel
Source§impl Ord for DebugLevel
impl Ord for DebugLevel
Source§fn cmp(&self, other: &DebugLevel) -> Ordering
fn cmp(&self, other: &DebugLevel) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DebugLevel
impl PartialEq for DebugLevel
Source§impl PartialOrd for DebugLevel
impl PartialOrd for DebugLevel
Source§impl Sub for DebugLevel
impl Sub for DebugLevel
Source§fn sub(self, other: DebugLevel) -> DebugLevel
fn sub(self, other: DebugLevel) -> DebugLevel
Returns the set difference of the two sets of flags.
Source§type Output = DebugLevel
type Output = DebugLevel
-
operator.Source§impl SubAssign for DebugLevel
impl SubAssign for DebugLevel
Source§fn sub_assign(&mut self, other: DebugLevel)
fn sub_assign(&mut self, other: DebugLevel)
Disables all flags enabled in the set.