Context::from_ref
This commit is contained in:
parent
db8e22c34d
commit
7d67e762b1
@ -31,6 +31,9 @@ impl Context{
|
|||||||
);
|
);
|
||||||
(Context{dom},crate::runner::instance::Script::new(script_ref),services)
|
(Context{dom},crate::runner::instance::Script::new(script_ref),services)
|
||||||
}
|
}
|
||||||
|
pub fn from_ref(dom:&WeakDom)->&Context{
|
||||||
|
unsafe{&*(dom as *const WeakDom as *const Context)}
|
||||||
|
}
|
||||||
pub fn from_mut(dom:&mut WeakDom)->&mut Context{
|
pub fn from_mut(dom:&mut WeakDom)->&mut Context{
|
||||||
unsafe{&mut *(dom as *mut WeakDom as *mut Context)}
|
unsafe{&mut *(dom as *mut WeakDom as *mut Context)}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user