use crate::KnowsVisitor;
pub trait HasParent: KnowsVisitor {
fn parent(&self) -> Option<Self::Visitor>;
}
pub unsafe trait HasParentMut: KnowsVisitor {
unsafe fn parent_mut(&mut self) -> Option<Self::VisitorMut>;
}
impl<T> HasParent for Box<T>
where T: HasParent
{
fn parent(&self) -> Option<Self::Visitor> {
self.as_ref().parent()
}
}
unsafe impl<T> HasParentMut for Box<T>
where T: HasParentMut
{
unsafe fn parent_mut(&mut self) -> Option<Self::VisitorMut> {
self.as_mut().parent_mut()
}
}