use windows::core::{IInspectable as CoreIInspectable, Interface};
#[repr(transparent)]
pub struct IInspectable {
inner: CoreIInspectable,
}
impl IInspectable {
pub fn cast<T: Interface>(&self) -> windows::core::Result<T> {
self.inner.cast()
}
pub fn inner(&self) -> &CoreIInspectable {
&self.inner
}
pub fn to_inner(&self) -> CoreIInspectable {
self.inner.clone()
}
}
impl From<CoreIInspectable> for IInspectable {
fn from(inner: CoreIInspectable) -> Self {
IInspectable { inner }
}
}
impl Clone for IInspectable {
fn clone(&self) -> Self {
IInspectable {
inner: self.inner.clone(),
}
}
}
unsafe impl Send for IInspectable {}
unsafe impl Sync for IInspectable {}