pub struct MutationObserverRegistry { /* private fields */ }Expand description
Registry of active MutationObservers.
Implementations§
Source§impl MutationObserverRegistry
impl MutationObserverRegistry
pub fn new() -> Self
Sourcepub fn observe(
&mut self,
target: NodeId,
options: MutationObserverOptions,
) -> u32
pub fn observe( &mut self, target: NodeId, options: MutationObserverOptions, ) -> u32
Register a new observer. Returns callback ID.
Sourcepub fn disconnect(&mut self, callback_id: u32)
pub fn disconnect(&mut self, callback_id: u32)
Disconnect an observer by callback ID.
Sourcepub fn notify_child_change(
&mut self,
target: NodeId,
added: &[NodeId],
removed: &[NodeId],
)
pub fn notify_child_change( &mut self, target: NodeId, added: &[NodeId], removed: &[NodeId], )
Notify observers of a child list change.
Sourcepub fn notify_attribute_change(
&mut self,
target: NodeId,
attribute_name: &str,
old_value: Option<&str>,
)
pub fn notify_attribute_change( &mut self, target: NodeId, attribute_name: &str, old_value: Option<&str>, )
Notify observers of an attribute change.
Sourcepub fn drain_pending(&mut self) -> Vec<(u32, String)>
pub fn drain_pending(&mut self) -> Vec<(u32, String)>
Drain pending records as JSON to deliver to JS callbacks.
Trait Implementations§
Source§impl Debug for MutationObserverRegistry
impl Debug for MutationObserverRegistry
Source§impl Default for MutationObserverRegistry
impl Default for MutationObserverRegistry
Source§fn default() -> MutationObserverRegistry
fn default() -> MutationObserverRegistry
Returns the “default value” for a type. Read more
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more