pub struct ExampleBitfieldExtra { /* private fields */ }
doc
or test
) and crate feature _bit_u8
only.Expand description
An example created with bitfield!
,
with public extra methods but no custom fields.
use devela::bitfield;
bitfield! {
(extra)
/// An example created with [`bitfield!`],
/// with public extra methods but no custom fields.
pub struct ExampleBitfieldExtra(u8) {}
}
Implementations§
Source§impl ExampleBitfieldExtra
§General bits manipulation functionality
impl ExampleBitfieldExtra
§General bits manipulation functionality
Sourcepub const fn new_zeroed() -> Self
pub const fn new_zeroed() -> Self
Returns self with all bits set to 0.
Sourcepub const fn count_ones(&self) -> u32 ⓘ
pub const fn count_ones(&self) -> u32 ⓘ
The number of bits set (number of ones).
Sourcepub const fn count_zeros(&self) -> u32 ⓘ
pub const fn count_zeros(&self) -> u32 ⓘ
The number of bits unset (number of zeros).
Sourcepub const fn is_bit_set(self, index: u32) -> bool
pub const fn is_bit_set(self, index: u32) -> bool
Sourcepub const fn is_checked_bit_set(
self,
index: u32,
) -> Result<bool, MismatchedBounds> ⓘ
pub const fn is_checked_bit_set( self, index: u32, ) -> Result<bool, MismatchedBounds> ⓘ
Sourcepub const fn get_bit(self, index: u32) -> Self
pub const fn get_bit(self, index: u32) -> Self
Returns a copy of self
with only the value of the bit at index
.
§Panics
Panics in debug if index > MAX_BIT
.
Sourcepub const fn get_checked_bit(self, index: u32) -> Result<Self, MismatchedBounds> ⓘ
pub const fn get_checked_bit(self, index: u32) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
with only the value of the bit at index
, checked.
§Errors
Returns IndexOutOfBounds
if index > MAX_BIT
.
Sourcepub const fn get_shifted_bit(self, index: u32) -> Self
pub const fn get_shifted_bit(self, index: u32) -> Self
Returns a copy of self
with only the value of the bit at index
shifted.
§Panics
Panics in debug if index > MAX_BIT
.
Sourcepub const fn get_shifted_checked_bit(
self,
index: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn get_shifted_checked_bit( self, index: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
with only the value of the bit at index
shifted, checked.
§Errors
Returns IndexOutOfBounds
if index > MAX_BIT
.
Sourcepub const fn set_checked_bit(self, index: u32) -> Result<Self, MismatchedBounds> ⓘ
pub const fn set_checked_bit(self, index: u32) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
setting the bit at index
, checked.
§Errors
Returns IndexOutOfBounds
if index > MAX_BIT
.
Sourcepub fn mut_set_bit(&mut self, index: u32)
pub fn mut_set_bit(&mut self, index: u32)
Sourcepub fn mut_set_checked_bit(
&mut self,
index: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_set_checked_bit( &mut self, index: u32, ) -> Result<(), MismatchedBounds> ⓘ
Sourcepub const fn unset_checked_bit(
self,
index: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn unset_checked_bit( self, index: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
unsetting the bit at index
, checked.
§Errors
Returns IndexOutOfBounds
if index > MAX_BIT
.
Sourcepub fn mut_unset_bit(&mut self, index: u32)
pub fn mut_unset_bit(&mut self, index: u32)
Sourcepub fn mut_unset_checked_bit(
&mut self,
index: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_unset_checked_bit( &mut self, index: u32, ) -> Result<(), MismatchedBounds> ⓘ
Sourcepub const fn flip_checked_bit(
self,
index: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn flip_checked_bit( self, index: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
flipping the bit at index
, checked.
§Errors
Returns IndexOutOfBounds
if index > MAX_BIT
.
Sourcepub fn mut_flip_bit(&mut self, index: u32)
pub fn mut_flip_bit(&mut self, index: u32)
Sourcepub fn mut_flip_checked_bit(
&mut self,
index: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_flip_checked_bit( &mut self, index: u32, ) -> Result<(), MismatchedBounds> ⓘ
Flips the bit at index
, checked.
Source§impl ExampleBitfieldExtra
§Bit ranges
impl ExampleBitfieldExtra
§Bit ranges
Sourcepub const fn mask_range(start: u32, end: u32) -> Self
pub const fn mask_range(start: u32, end: u32) -> Self
Returns a new bitmask of 1s from the [start..=end]
range.
Sets the rest of the bits to 0.
§Panics
Panics if start >= BITS || end >= BITS || start > end
.
Sourcepub const fn mask_checked_range(
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a new bitmask of ones from the [start..=end]
checked range.
Sets the rest of the bits to 0.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub const fn get_range(self, start: u32, end: u32) -> Self
pub const fn get_range(self, start: u32, end: u32) -> Self
Gets a copy of self
with only the bits from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub const fn get_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Gets a copy of self
with only the bits from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub const fn get_value_range(self, start: u32, end: u32) -> Self
pub const fn get_value_range(self, start: u32, end: u32) -> Self
Gets the value of the bits in from the [start..=end]
range.
§Panics
Panics if start >= BITS || end >= BITS || start > end
.
Sourcepub const fn get_value_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Gets the value of the bits from the [start..=end]
checked range.
Sets the rest of the bits to 0.
The bits in the specified range are shifted rightwards so that the least significant bit (LSB) aligns with the units place, forming the integer value.
§Errors
Returns IndexOutOfBounds
if start >= BITS || end >= BITS
,
MismatchedIndices
if start > end
, and
DataOverflow
if value
does not fit within the specified bit range.
Sourcepub const fn set_range(self, start: u32, end: u32) -> Self
pub const fn set_range(self, start: u32, end: u32) -> Self
Get a copy of self
with bits set to 1 from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub const fn set_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Get a copy of self
with bits set to 1 from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub fn mut_set_range(&mut self, start: u32, end: u32)
pub fn mut_set_range(&mut self, start: u32, end: u32)
Sets the bits from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub fn mut_set_checked_range(
&mut self,
start: u32,
end: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_set_checked_range( &mut self, start: u32, end: u32, ) -> Result<(), MismatchedBounds> ⓘ
Sets the bits from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub const fn set_value_range(self, value: u8, start: u32, end: u32) -> Self
pub const fn set_value_range(self, value: u8, start: u32, end: u32) -> Self
Gets a copy of self
with the given value
set into the [start..=end]
range.
Leaves the rest of the bits unchanged.
The value is first masked to fit the size of the range, and then
it is inserted into the specified bit range of self
, replacing
the existing bits in that range. The rest of the bits in self
remain unchanged.
§Panics
Panics if start >= BITS || end >= BITS || start > end
.
Sourcepub const fn set_value_checked_range(
self,
value: u8,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn set_value_checked_range( self, value: u8, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Gets a copy of self
with the given value
set into the [start..=end]
checked range.
Leaves the rest of the bits unchanged.
§Errors
Returns IndexOutOfBounds
if start >= BITS || end >= BITS
and MismatchedIndices
if start > end
.
Sourcepub const fn set_checked_value_checked_range(
self,
value: u8,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn set_checked_value_checked_range( self, value: u8, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Gets a copy of self
with the given checked value
set into the [start..=end]
checked range.
Leaves the rest of the bits unchanged.
§Errors
Returns IndexOutOfBounds
if start >= BITS || end >= BITS
,
MismatchedIndices
if start > end
, and
DataOverflow
if value
does not fit within the specified bit range.
Sourcepub fn mut_set_value_range(&mut self, value: u8, start: u32, end: u32)
pub fn mut_set_value_range(&mut self, value: u8, start: u32, end: u32)
Sets the given value
into the [start..=end]
range.
Sets the bits from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub fn mut_set_value_checked_range(
&mut self,
value: u8,
start: u32,
end: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_set_value_checked_range( &mut self, value: u8, start: u32, end: u32, ) -> Result<(), MismatchedBounds> ⓘ
Sets the given value
into the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
and
MismatchedIndices
if start > end
.
Sourcepub fn mut_set_checked_value_checked_range(
&mut self,
value: u8,
start: u32,
end: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_set_checked_value_checked_range( &mut self, value: u8, start: u32, end: u32, ) -> Result<(), MismatchedBounds> ⓘ
Sets the given checked value
into the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
MismatchedIndices
if start > end
, and
DataOverflow
if value
does not fit within the specified bit range.
Sourcepub const fn unset_range(self, start: u32, end: u32) -> Self
pub const fn unset_range(self, start: u32, end: u32) -> Self
Returns a copy of self
with unset bits to 0 from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub const fn unset_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
with unset bits to 0 from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub fn mut_unset_range(&mut self, start: u32, end: u32)
pub fn mut_unset_range(&mut self, start: u32, end: u32)
Unsets the bits from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub fn mut_unset_checked_range(
&mut self,
start: u32,
end: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_unset_checked_range( &mut self, start: u32, end: u32, ) -> Result<(), MismatchedBounds> ⓘ
Unsets the bits from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub const fn flip_range(self, start: u32, end: u32) -> Self
pub const fn flip_range(self, start: u32, end: u32) -> Self
Returns a copy of self
with flipped bits from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub const fn flip_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
pub const fn flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a copy of self
with flipped bits from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Sourcepub fn mut_flip_range(&mut self, start: u32, end: u32)
pub fn mut_flip_range(&mut self, start: u32, end: u32)
Flips the bits from the [start..=end]
range.
§Panics
Panics in debug if start > MAX_BIT || end > MAX_BIT
or if start > end
.
Sourcepub fn mut_flip_checked_range(
&mut self,
start: u32,
end: u32,
) -> Result<(), MismatchedBounds> ⓘ
pub fn mut_flip_checked_range( &mut self, start: u32, end: u32, ) -> Result<(), MismatchedBounds> ⓘ
Flips the bits from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start > MAX_BIT || end > MAX_BIT
,
or MismatchedIndices
if start > end
.
Source§impl ExampleBitfieldExtra
§Bit masks
impl ExampleBitfieldExtra
§Bit masks
Sourcepub const fn contains_mask(self, mask: u8) -> bool
pub const fn contains_mask(self, mask: u8) -> bool
Whether self
contains all the same set bits that are set in mask
.
Sourcepub const fn contains_other(self, other: Self) -> bool
pub const fn contains_other(self, other: Self) -> bool
Whether self
contains all the same set bits that are set in other
.
Sourcepub const fn overlaps_mask(&self, mask: u8) -> bool
pub const fn overlaps_mask(&self, mask: u8) -> bool
Whether there’s at least one set bit in common between self
and mask
.
Sourcepub const fn overlaps_other(&self, other: Self) -> bool
pub const fn overlaps_other(&self, other: Self) -> bool
Whether there’s at least one set bit in common between self
and other
.
Sourcepub const fn intersect_mask(self, mask: u8) -> Self
pub const fn intersect_mask(self, mask: u8) -> Self
A copy of self
with only the bits both in self
and mask
.
Sourcepub const fn intersect_other(self, other: Self) -> Self
pub const fn intersect_other(self, other: Self) -> Self
A copy of self
with only the bits both in self
and other
.
Sourcepub fn mut_intersect_mask(&mut self, mask: u8)
pub fn mut_intersect_mask(&mut self, mask: u8)
Only leaves the bits both in self
and mask
.
Sourcepub fn mut_intersect_other(&mut self, other: Self)
pub fn mut_intersect_other(&mut self, other: Self)
Only leaves the bits both in self
and other
.
Sourcepub const fn set_mask(self, mask: u8) -> Self
pub const fn set_mask(self, mask: u8) -> Self
A copy of self
setting the bits that are set in mask
.
Sourcepub const fn set_other(self, other: Self) -> Self
pub const fn set_other(self, other: Self) -> Self
A copy of self
setting the bits that are set in other
.
Sourcepub fn mut_set_mask(&mut self, mask: u8)
pub fn mut_set_mask(&mut self, mask: u8)
Sets the bits that are set in mask
.
Sourcepub fn mut_set_other(&mut self, other: Self)
pub fn mut_set_other(&mut self, other: Self)
Sets the bits that are set in other
.
Sourcepub const fn unset_mask(self, mask: u8) -> Self
pub const fn unset_mask(self, mask: u8) -> Self
A copy of self
unsetting the bits that are set in mask
.
Sourcepub const fn unset_other(self, other: Self) -> Self
pub const fn unset_other(self, other: Self) -> Self
A copy of self
unsetting the bits that are set in other
.
Sourcepub fn mut_unset_mask(&mut self, mask: u8)
pub fn mut_unset_mask(&mut self, mask: u8)
Unsets the bits that are set in mask
.
Sourcepub fn mut_unset_other(&mut self, other: Self)
pub fn mut_unset_other(&mut self, other: Self)
Unsets the bits that are set in other
.
Sourcepub const fn flip_mask(self, mask: u8) -> Self
pub const fn flip_mask(self, mask: u8) -> Self
A copy of self
flipping the bits that are set in mask
.
Sourcepub const fn flip_other(self, other: Self) -> Self
pub const fn flip_other(self, other: Self) -> Self
Returns a copy of self
flipping the bits that are set in other
.
Sourcepub fn mut_flip_mask(&mut self, mask: u8)
pub fn mut_flip_mask(&mut self, mask: u8)
Flips the bits that are set in mask
.
Sourcepub fn mut_flip_other(&mut self, other: Self)
pub fn mut_flip_other(&mut self, other: Self)
Flips the bits that are set in other
.
Trait Implementations§
Source§impl Binary for ExampleBitfieldExtra
impl Binary for ExampleBitfieldExtra
Source§impl Clone for ExampleBitfieldExtra
impl Clone for ExampleBitfieldExtra
Source§fn clone(&self) -> ExampleBitfieldExtra
fn clone(&self) -> ExampleBitfieldExtra
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExampleBitfieldExtra
impl Debug for ExampleBitfieldExtra
Source§impl Default for ExampleBitfieldExtra
impl Default for ExampleBitfieldExtra
Source§impl Display for ExampleBitfieldExtra
impl Display for ExampleBitfieldExtra
Source§impl Hash for ExampleBitfieldExtra
impl Hash for ExampleBitfieldExtra
Source§impl LowerExp for ExampleBitfieldExtra
impl LowerExp for ExampleBitfieldExtra
Source§impl LowerHex for ExampleBitfieldExtra
impl LowerHex for ExampleBitfieldExtra
Source§impl Octal for ExampleBitfieldExtra
impl Octal for ExampleBitfieldExtra
Source§impl Ord for ExampleBitfieldExtra
impl Ord for ExampleBitfieldExtra
Source§fn cmp(&self, other: &ExampleBitfieldExtra) -> Ordering
fn cmp(&self, other: &ExampleBitfieldExtra) -> 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 ExampleBitfieldExtra
impl PartialEq for ExampleBitfieldExtra
Source§impl PartialOrd for ExampleBitfieldExtra
impl PartialOrd for ExampleBitfieldExtra
Source§impl UpperExp for ExampleBitfieldExtra
impl UpperExp for ExampleBitfieldExtra
Source§impl UpperHex for ExampleBitfieldExtra
impl UpperHex for ExampleBitfieldExtra
impl Copy for ExampleBitfieldExtra
impl Eq for ExampleBitfieldExtra
impl StructuralPartialEq for ExampleBitfieldExtra
Auto Trait Implementations§
impl Freeze for ExampleBitfieldExtra
impl RefUnwindSafe for ExampleBitfieldExtra
impl Send for ExampleBitfieldExtra
impl Sync for ExampleBitfieldExtra
impl Unpin for ExampleBitfieldExtra
impl UnwindSafe for ExampleBitfieldExtra
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize
fn byte_align(&self) -> usize
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64
TypeId
of Self
using a custom hasher.Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of<T>() -> usize
fn mem_align_of<T>() -> usize
Source§fn mem_align_of_val(&self) -> usize
fn mem_align_of_val(&self) -> usize
Source§fn mem_size_of<T>() -> usize
fn mem_size_of<T>() -> usize
Source§fn mem_size_of_val(&self) -> usize
fn mem_size_of_val(&self) -> usize
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more