fn mask<R>(
		from: impl Into<Option<BitIdx<R>>>,
		upto: impl Into<Option<BitEnd<R>>>,
	) -> BitMask<R>
	where
		R: BitRegister,
	{
		let (from, upto) = match (from.into(), upto.into()) {
			(None, None) => return BitMask::ALL,
			(Some(from), None) => (from, BitEnd::MAX),
			(None, Some(upto)) => (BitIdx::MIN, upto),
			(Some(from), Some(upto)) => (from, upto),
		};
		from.range(upto).map(Self::select::<R>).sum()
	}
/// Produces a multi-bit selection mask from a range of bit-indices.
///
/// This is an optional function: it is implemented as, and must always be
/// exactly identical to,
/// `BitIdx::range(from, upto).map(BitOrder::select).sum()`. If your
/// ordering has a faster implementation, you may provide it, but it must be
/// exactly numerically equivalent.
///
/// ## Parameters
///
/// - `from`: The inclusive starting value of the indices being selected.
///   Defaults to [`BitIdx::MIN`].
/// - `upto`: The exclusive ending value of the indices being selected.
///   Defaults to [`BitEnd::MAX`].
///
/// ## Returns
///
/// A selection mask with all bit-positions corresponding to `from .. upto`
/// selected.
///
/// [`BitEnd::MAX`]: crate::index::BitEnd::MAX
/// [`BitIdx::MIN`]: crate::index::BitIdx::MIN
Produces a multi-bit selection mask from a range of bit-indices.
Produces a multi - bit selection mask from a range of bit - indices .
fn mask<R>(
		from: impl Into<Option<BitIdx<R>>>,
		upto: impl Into<Option<BitEnd<R>>>,
	) -> BitMask<R>
	where
		R: BitRegister,
	{
		let (from, upto) = match (from.into(), upto.into()) {
			(None, None) => return BitMask::ALL,
			(Some(from), None) => (from, BitEnd::MAX),
			(None, Some(upto)) => (BitIdx::MIN, upto),
			(Some(from), Some(upto)) => (from, upto),
		};
		from.range(upto).map(Self::select::<R>).sum()
	}
fn mask < R > ( from : impl Into < Option < BitIdx < R > > > , upto : impl Into < Option < BitEnd < R > > > , ) -> BitMask < R > where R : BitRegister , { let ( from , upto ) = match ( from . into ( ) , upto . into ( ) ) { ( None , None ) => return BitMask :: ALL , ( Some ( from ) , None ) => ( from , BitEnd :: MAX ) , ( None , Some ( upto ) ) => ( BitIdx :: MIN , upto ) , ( Some ( from ) , Some ( upto ) ) => ( from , upto ) , } ; from . range ( upto ) . map ( Self :: select :: < R > ) . sum ( ) }
Produces a multi-bit selection mask from a range of bit-indices.
Produces a multi - bit selection mask from a range of bit - indices .
from
impl Into<Option<BitIdx<R>>>
upto
impl Into<Option<BitEnd<R>>>
A selection mask with all bit-positions corresponding to `from .. upto`
selected.

[`BitEnd::MAX`]: crate::index::BitEnd::MAX
[`BitIdx::MIN`]: crate::index::BitIdx::MIN
A selection mask with all bit - positions corresponding to ` from .. upto ` selected . [ ` BitEnd :: MAX ` ] : crate :: index :: BitEnd :: MAX [ ` BitIdx :: MIN ` ] : crate :: index :: BitIdx :: MIN
from
impl Into<Option<BitIdx<R>>>
The inclusive starting value of the indices being selected.
Defaults to [`BitIdx::MIN`].
The inclusive starting value of the indices being selected . Defaults to [ ` BitIdx :: MIN ` ] .
upto
impl Into<Option<BitEnd<R>>>
The exclusive ending value of the indices being selected.
Defaults to [`BitEnd::MAX`].
The exclusive ending value of the indices being selected . Defaults to [ ` BitEnd :: MAX ` ] .