context take a &mut WeakDom to simplify external business
This commit is contained in:
parent
c7c17243fb
commit
f84bd5651e
@ -10,16 +10,13 @@ pub fn class_is_a(class:&str,superclass:&str)->bool{
|
||||
)
|
||||
}
|
||||
|
||||
pub struct Context{
|
||||
pub(crate)dom:WeakDom,
|
||||
pub struct Context<'a>{
|
||||
pub(crate)dom:&'a mut WeakDom,
|
||||
}
|
||||
|
||||
impl Context{
|
||||
pub const fn new(dom:WeakDom)->Self{
|
||||
Self{dom}
|
||||
}
|
||||
pub fn into_inner(self)->WeakDom{
|
||||
self.dom
|
||||
impl Context<'_>{
|
||||
pub fn new(dom:&mut WeakDom)->Context<'_>{
|
||||
Context{dom}
|
||||
}
|
||||
/// Creates an iterator over all items of a particular class.
|
||||
pub fn superclass_iter<'a>(&'a self,superclass:&'a str)->impl Iterator<Item=Ref>+'a{
|
||||
|
Loading…
Reference in New Issue
Block a user