Skip to main content

MutationObserverRegistry

Struct MutationObserverRegistry 

Source
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

Source

pub fn new() -> Self

Source

pub fn allocate_id(&mut self) -> u32

Source

pub fn register( &mut self, observer_id: u32, target_idx: usize, options: MutationObserverOptions, )

W3C 仕様: 同一 observer_id かつ同一 target_idx の登録は既存を更新、別 target_idx は追加

Source

pub fn disconnect(&mut self, observer_id: u32)

disconnect(): 当該 observer_id の全登録と保留レコードを破棄

Source

pub fn take_records(&mut self, observer_id: u32) -> Vec<MutationRecord>

takeRecords(): 当該 observer_id の保留レコードを取り出してクリア

Source

pub fn notify_child_list<F>( &mut self, parent_idx: usize, added: Vec<usize>, removed: Vec<usize>, is_ancestor: F, )
where F: Fn(usize, usize) -> bool,

childList 変化を通知

Source

pub fn notify_attribute<F>( &mut self, target_idx: usize, attr_name: &str, old_val: Option<&str>, is_ancestor: F, )
where F: Fn(usize, usize) -> bool,

属性変化を通知

Source

pub fn notify_character_data<F>( &mut self, target_idx: usize, old_val: Option<&str>, is_ancestor: F, )
where F: Fn(usize, usize) -> bool,

characterData 変化を通知

Source

pub fn drain_all_grouped(&mut self) -> BTreeMap<u32, Vec<MutationRecord>>

全レコードを一括ドレイン(observer_id ごとにグループ化)

Trait Implementations§

Source§

impl Clone for MutationObserverRegistry

Source§

fn clone(&self) -> MutationObserverRegistry

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MutationObserverRegistry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MutationObserverRegistry

Source§

fn default() -> MutationObserverRegistry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.