#![allow(clippy::module_name_repetitions)]
pub mod traits {
pub use super::{AsRaw, AsRawMut, FromRaw, MatchesRaw};
}
pub unsafe trait AsRaw {
type Raw;
fn as_raw(&self) -> Self::Raw;
}
unsafe impl<'a, T> AsRaw for &'a T
where
T: 'a + AsRaw,
{
type Raw = <T as AsRaw>::Raw;
fn as_raw(&self) -> Self::Raw {
(*self).as_raw()
}
}
pub unsafe trait AsRawMut: AsRaw {
fn as_raw_mut(&mut self) -> *mut <Self as AsRaw>::Raw;
}
pub trait FromRaw: AsRaw {
unsafe fn from_raw(handle: <Self as AsRaw>::Raw) -> Self;
}
pub unsafe trait MatchesRaw: AsRaw {}