// Copyright 2025 Gabriel Bjørnager Jensen.

mod test;

use crate::UintLeast16;

use core::convert::Infallible;

/// Denotes an unsigned integer that is at least as wide as [`u32`].
///
/// # Safety
///
/// Only primitive, unsigned, integral types that fit the size requirement may implement this type.
pub trait UintLeast32
where
	Self:
		crate::seal::UintLeast32
		+ UintLeast16
		+ From<char>
		+ From<u32>
		+ TryFrom<char, Error = Infallible>
		+ TryFrom<u32,  Error = Infallible>,
{}

macro_rules! impl_uint_least32 {
	{ $($Ty:ty),*$(,)? } => {$(
		impl ::multitype::seal::UintLeast32 for $Ty {}

		impl ::multitype::UintLeast32 for $Ty {}
	)*};
}

impl_uint_least32! {
	u32,
	u64,
	u128,
}
