use sealed::sealed;
use crate::raw_assert::r#trait::RawAssertable;
/// A trait representing any type that is assertable by beeing
/// turned into another assertable type.
pub trait Assertable<'a> {
/// The other assertable type the assert should be turned into.
///
/// # Useful types
/// ## Tuples
/// This may be a tuple type (T1, ..., T32) as [`RawAssertable`] is
/// implemented for tuples of up to a length of 32.
/// If more assets need to be combined, you can just nest multiple tuples.
///
/// ## `RawAssert`
/// Actual impl here: [`RawAssert`](crate::raw_assert::RawAssert)
///
/// This is useful for wrapper types around [`Generatable`](crate::generatable::Generatable) types.
type Output: RawAssertable<'a>;
fn do_assert(self) -> Self::Output;
}
#[sealed]
impl<'a, A> crate::raw_assert::r#trait::RawAssertable<'a> for A
where
A: Assertable<'a>,
{
fn do_raw_assert<I>(self, store: &mut crate::store::Store<'a, I>)
where
I: crate::ident_generator::IdentGenerator,
{
self.do_assert().do_raw_assert(store);
}
}