pub fn new(idx: u8) -> Result<Self, BitIdxError<R>> {
		if idx >= bits_of::<R>() as u8 {
			return Err(BitIdxError::new(idx));
		}
		Ok(unsafe { Self::new_unchecked(idx) })
	}
/// Wraps a counter value as a known-good index into an `R` register.
///
/// ## Parameters
///
/// - `idx`: The counter value to mark as an index. This must be in the
///   range `0 .. R::BITS`.
///
/// ## Returns
///
/// This returns `idx`, either marked as a valid `BitIdx` or an invalid
/// `BitIdxError` by whether it is within the valid range `0 .. R::BITS`.
Wraps a counter value as a known-good index into an `R` register.
Wraps a counter value as a known - good index into an ` R ` register .
pub fn new(idx: u8) -> Result<Self, BitIdxError<R>> {
		if idx >= bits_of::<R>() as u8 {
			return Err(BitIdxError::new(idx));
		}
		Ok(unsafe { Self::new_unchecked(idx) })
	}
pub fn new ( idx : u8 ) -> Result < Self , BitIdxError < R > > { if idx >= bits_of :: < R > ( ) as u8 { return Err ( BitIdxError :: new ( idx ) ) ; } Ok ( unsafe { Self :: new_unchecked ( idx ) } ) }
Wraps a counter value as a known-good index into an `R` register.
Wraps a counter value as a known - good index into an ` R ` register .
idx
u8
This returns `idx`, either marked as a valid `BitIdx` or an invalid
`BitIdxError` by whether it is within the valid range `0 ..
This returns ` idx ` either marked as a valid ` BitIdx ` or an invalid ` BitIdxError ` by whether it is within the valid range ` 0 ..
idx
u8
The counter value to mark as an index. This must be in the
range `0 ..
The counter value to mark as an index . This must be in the range ` 0 ..