// Copyright 2025 Gabriel Bjørnager Jensen.

mod test;

use crate::Uint;

use core::convert::Infallible;

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

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

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

impl_uint_least16! {
	u16,
	u32,
	u64,
	u128,
	usize,
}
