pub struct MutationObserverRegistry {
pub next_observer_id: u32,
pub registrations: Vec<RegisteredObserver>,
pub records: Vec<(u32, MutationRecord)>,
}Expand description
MutationObserver 管理コア状態機械
Fields§
§next_observer_id: u32§registrations: Vec<RegisteredObserver>§records: Vec<(u32, MutationRecord)>Implementations§
Source§impl MutationObserverRegistry
impl MutationObserverRegistry
pub fn new() -> Self
pub fn allocate_id(&mut self) -> u32
Sourcepub fn register(
&mut self,
observer_id: u32,
target_idx: usize,
options: MutationObserverOptions,
)
pub fn register( &mut self, observer_id: u32, target_idx: usize, options: MutationObserverOptions, )
W3C 仕様: 同一 observer_id かつ同一 target_idx の登録は既存を更新、別 target_idx は追加
Sourcepub fn disconnect(&mut self, observer_id: u32)
pub fn disconnect(&mut self, observer_id: u32)
disconnect(): 当該 observer_id の全登録と保留レコードを破棄
Sourcepub fn take_records(&mut self, observer_id: u32) -> Vec<MutationRecord>
pub fn take_records(&mut self, observer_id: u32) -> Vec<MutationRecord>
takeRecords(): 当該 observer_id の保留レコードを取り出してクリア
Sourcepub fn notify_child_list<F>(
&mut self,
parent_idx: usize,
added: Vec<usize>,
removed: Vec<usize>,
is_ancestor: F,
)
pub fn notify_child_list<F>( &mut self, parent_idx: usize, added: Vec<usize>, removed: Vec<usize>, is_ancestor: F, )
childList 変化を通知
Sourcepub fn notify_attribute<F>(
&mut self,
target_idx: usize,
attr_name: &str,
old_val: Option<&str>,
is_ancestor: F,
)
pub fn notify_attribute<F>( &mut self, target_idx: usize, attr_name: &str, old_val: Option<&str>, is_ancestor: F, )
属性変化を通知
Sourcepub fn notify_character_data<F>(
&mut self,
target_idx: usize,
old_val: Option<&str>,
is_ancestor: F,
)
pub fn notify_character_data<F>( &mut self, target_idx: usize, old_val: Option<&str>, is_ancestor: F, )
characterData 変化を通知
Sourcepub fn drain_all_grouped(&mut self) -> BTreeMap<u32, Vec<MutationRecord>>
pub fn drain_all_grouped(&mut self) -> BTreeMap<u32, Vec<MutationRecord>>
全レコードを一括ドレイン(observer_id ごとにグループ化)
Trait Implementations§
Source§impl Clone for MutationObserverRegistry
impl Clone for MutationObserverRegistry
Source§impl Debug for MutationObserverRegistry
impl Debug for MutationObserverRegistry
Auto Trait Implementations§
impl Freeze for MutationObserverRegistry
impl RefUnwindSafe for MutationObserverRegistry
impl Send for MutationObserverRegistry
impl Sync for MutationObserverRegistry
impl Unpin for MutationObserverRegistry
impl UnsafeUnpin for MutationObserverRegistry
impl UnwindSafe for MutationObserverRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more