#![warn(missing_docs)]
#![doc = include_str!("../README.md")]
pub use facet_spez;
pub use facet_opaque::*;
pub use facet_types::*;
mod impls;
mod macros;
pub use macros::*;
pub unsafe trait Facet: Sized {
const SHAPE: &'static Shape;
const ARCHETYPE: Self;
fn type_eq<Other: Facet>() -> bool {
Self::SHAPE == Other::SHAPE
}
}
pub trait ShapeExt {
fn is_type<Other: Facet>(&'static self) -> bool;
fn assert_type<Other: Facet>(&'static self);
}
impl ShapeExt for Shape {
fn is_type<Other: Facet>(&'static self) -> bool {
self == Other::SHAPE
}
fn assert_type<Other: Facet>(&'static self) {
assert!(
self.is_type::<Other>(),
"Type mismatch: expected {}, found {self}",
Other::SHAPE,
);
}
}