pub trait BitOpswhere
Self: Sized,{
type Inner;
Show 29 methods
// Required methods
fn bit_mask_range(start: u32, end: u32) -> Self;
fn bit_mask_checked_range(
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_get_range(self, start: u32, end: u32) -> Self;
fn bit_get_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_get_value_range(self, start: u32, end: u32) -> Self;
fn bit_get_value_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_set_range(self, start: u32, end: u32) -> Self;
fn bit_set_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_set_value_range(
self,
value: Self::Inner,
start: u32,
end: u32,
) -> Self;
fn bit_set_value_checked_range(
self,
value: Self::Inner,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_set_checked_value_checked_range(
self,
value: Self::Inner,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_unset_range(self, start: u32, end: u32) -> Self;
fn bit_unset_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_flip_range(self, start: u32, end: u32) -> Self;
fn bit_flip_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_reverse_range(self, start: u32, end: u32) -> Self;
fn bit_reverse_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ;
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ;
fn bit_count_ones_checked_range(
self,
start: u32,
end: u32,
) -> Result<u32, MismatchedBounds> ⓘ;
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ;
fn bit_count_zeros_checked_range(
self,
start: u32,
end: u32,
) -> Result<u32, MismatchedBounds> ⓘ;
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ;
fn bit_find_first_one_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ;
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ;
fn bit_find_first_zero_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ;
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ;
fn bit_find_last_one_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ;
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ;
fn bit_find_last_zero_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ;
}
Expand description
Provides bitwise operations on T
.
See also Bitwise
for the equivalent const wrapper.
Required Associated Types§
Required Methods§
Sourcefn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_range(start: u32, end: u32) -> Self
Returns a bitmask of ones from the [start..=end]
range.
Sets the rest of the bits to 0.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
§Benchmarks
The current algorithm used can be more than 1 order of magnitude more efficient than a naive loop that sets the individual bits, as well as much more consistant across the spectrum of bitsizes.
The following table shows the compared benchmark for start=0
and end=BITS-1
measured on an i5-8350U CPU @ 1.70 Ghz:
bits current naive
---- ------- --------
128 2.8 ns 163.0 ns
64 2.0 ns 21.6 ns
32 2.4 ns 12.1 ns
16 2.6 ns 7.6 ns
8 2.9 ns 8.4 ns
Sourcefn bit_mask_checked_range(
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Returns a bitmask of ones from the [start..=end]
checked range.
Sets the rest of the bits to 0.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
§Benchmarks
The current algorithm used can be more than 1 order of magnitude more efficient than a naive loop that sets the individual bits, as well as much more consistant across the spectrum of bitsizes.
The following table shows the compared benchmark for start=0
and end=BITS-1
measured on an i5-8350U CPU @ 1.70 Ghz:
bits current naive
---- ------- --------
128 3.7 ns 145.0 ns
64 3.2 ns 38.2 ns
32 3.2 ns 9.0 ns
16 3.2 ns 7.0 ns
8 3.1 ns 6.7 ns
Sourcefn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_range(self, start: u32, end: u32) -> Self
Gets the bits in self
from the [start..=end]
range.
Sets the rest of the bits to 0.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_get_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Gets the bits in self
from the [start..=end]
checked range.
Sets the rest of the bits to 0.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_range(self, start: u32, end: u32) -> Self
Gets the rightwards shifted bits in self
from the [start..=end]
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.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_get_value_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Gets the rightwards shifted bits in self
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 >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_range(self, start: u32, end: u32) -> Self
Sets the bits in self
to 1 from the [start..=end]
range.
Leaves the rest of the bits untouched.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_set_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Sets the bits in self
to 1 from the [start..=end]
checked range.
Leaves the rest of the bits untouched.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
Sets the given value
into the bits from 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
.
Sourcefn bit_set_value_checked_range(
self,
value: Self::Inner,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Sets the given value
into the bits from 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
.
Sourcefn bit_set_checked_value_checked_range(
self,
value: Self::Inner,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Sets the given checked value
into the bits from 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.
Sourcefn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_range(self, start: u32, end: u32) -> Self
Unsets the bits in self
to 0 from the [start..=end]
range.
Leaves the rest of the bits untouched.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_unset_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Unsets the bits in self
to 0 from the [start..=end]
checked range.
Leaves the rest of the bits untouched.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_range(self, start: u32, end: u32) -> Self
Flips the bits in self
from the [start..=end]
range.
Leaves the rest of the bits untouched.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_flip_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Flips the bits in self
from the [start..=end]
checked range.
Leaves the rest of the bits untouched.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_range(self, start: u32, end: u32) -> Self
Reverses the order of the bits in self
from the [start..=end]
range.
Leaves the rest of the bits untouched.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_reverse_checked_range(
self,
start: u32,
end: u32,
) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
Reverses the order of the bits in self
from the [start..=end]
checked range.
Leaves the rest of the bits untouched.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
Counts the number of 1s in bits
from the [start..=end]
range.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_count_ones_checked_range(
self,
start: u32,
end: u32,
) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
Counts the number of 1s in bits
from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
Counts the number of 0s in bits
from the [start..=end]
range.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_count_zeros_checked_range(
self,
start: u32,
end: u32,
) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
Counts the number of 0s in bits
from the [start..=end]
checked range.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
Finds the index of the first 1 in bits
from the [start..=end]
range.
Returns None
if there are no bits set.
The index is relative to the entire sequence of bits
, not to the given start
.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_find_first_one_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Finds the index of the first 1 in bits
from the [start..=end]
checked range.
Returns None
if there are no bits set.
The index is relative to the entire sequence of bits
, not to the given start
.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
Finds the index of the first 0 in bits
from the [start..=end]
range.
Returns None
if there are no bits unset.
The index is relative to the entire sequence of bits
, not to the given start
.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_find_first_zero_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Finds the index of the first 0 in bits
from the [start..=end]
checked range.
Returns None
if there are no bits unset.
The index is relative to the entire sequence of bits
, not to the given start
.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
Finds the index of the last 1 in bits
from the [start..=end]
range.
Returns None
if there are no bits set.
The index is relative to the entire sequence of bits
, not to the given start
.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_find_last_one_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Finds the index of the last 1 in bits
from the [start..=end]
checked range.
Returns None
if there are no bits set.
The index is relative to the entire sequence of bits
, not to the given start
.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Sourcefn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
Finds the index of the last 0 in bits
from the [start..=end]
range.
Returns None
if there are no bits unset.
The index is relative to the entire sequence of bits
, not to the given start
.
§Panics
Panics in debug if start >= Self::BITS
|| end >= Self::BITS
|| start > end
.
Sourcefn bit_find_last_zero_checked_range(
self,
start: u32,
end: u32,
) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Finds the index of the last 0 in bits
from the [start..=end]
checked range.
Returns None
if there are no bits unset.
The index is relative to the entire sequence of bits
, not to the given start
.
§Errors
Returns IndexOutOfBounds
if start >= Self::BITS
|| end >= Self::BITS
and MismatchedIndices
if start > end
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl BitOps for i8
Available on crate feature _bit_i8
only.
impl BitOps for i8
_bit_i8
only.type Inner = i8
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for i16
Available on crate feature _bit_i16
only.
impl BitOps for i16
_bit_i16
only.type Inner = i16
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for i32
Available on crate feature _bit_i32
only.
impl BitOps for i32
_bit_i32
only.type Inner = i32
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for i64
Available on crate feature _bit_i64
only.
impl BitOps for i64
_bit_i64
only.type Inner = i64
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for i128
Available on crate feature _bit_i128
only.
impl BitOps for i128
_bit_i128
only.type Inner = i128
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for isize
Available on crate feature _bit_isize
only.
impl BitOps for isize
_bit_isize
only.type Inner = isize
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for u8
Available on crate feature _bit_u8
only.
impl BitOps for u8
_bit_u8
only.type Inner = u8
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for u16
Available on crate feature _bit_u16
only.
impl BitOps for u16
_bit_u16
only.type Inner = u16
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for u32
Available on crate feature _bit_u32
only.
impl BitOps for u32
_bit_u32
only.type Inner = u32
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for u64
Available on crate feature _bit_u64
only.
impl BitOps for u64
_bit_u64
only.type Inner = u64
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for u128
Available on crate feature _bit_u128
only.
impl BitOps for u128
_bit_u128
only.type Inner = u128
fn bit_mask_range(start: u32, end: u32) -> Self
fn bit_mask_checked_range( start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_range(self, start: u32, end: u32) -> Self
fn bit_get_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_get_value_range(self, start: u32, end: u32) -> Self
fn bit_get_value_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_range(self, start: u32, end: u32) -> Self
fn bit_set_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_value_range(self, value: Self::Inner, start: u32, end: u32) -> Self
fn bit_set_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_set_checked_value_checked_range( self, value: Self::Inner, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_unset_range(self, start: u32, end: u32) -> Self
fn bit_unset_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_flip_range(self, start: u32, end: u32) -> Self
fn bit_flip_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_reverse_range(self, start: u32, end: u32) -> Self
fn bit_reverse_checked_range( self, start: u32, end: u32, ) -> Result<Self, MismatchedBounds> ⓘ
fn bit_count_ones_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_ones_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_count_zeros_range(self, start: u32, end: u32) -> u32 ⓘ
fn bit_count_zeros_checked_range( self, start: u32, end: u32, ) -> Result<u32, MismatchedBounds> ⓘ
fn bit_find_first_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_first_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_first_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_one_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_one_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
fn bit_find_last_zero_range(self, start: u32, end: u32) -> Option<u32> ⓘ
fn bit_find_last_zero_checked_range( self, start: u32, end: u32, ) -> Result<Option<u32>, MismatchedBounds> ⓘ
Source§impl BitOps for usize
Available on crate feature _bit_usize
only.
impl BitOps for usize
_bit_usize
only.