[][src]Struct stdweb::web::MutationObserverHandle

pub struct MutationObserverHandle { /* fields omitted */ }

A wrapper which ensures that memory is properly cleaned up when it's no longer needed.

This is created by the MutationObserver::new method, and it can use the same methods as MutationObserver.

When the MutationObserverHandle is dropped, the disconnect method will automatically be called.

Methods from Deref<Target = MutationObserver>

pub fn observe<T: INode>(
    &self,
    target: &T,
    options: MutationObserverInit
) -> Result<(), TODO>
[src]

Starts observing changes to the target.

When the target is changed, the MutationObserver is notified with a vector of MutationRecord.

The options specifies which changes should be observed.

Multiple different targets can be observed simultaneously (with the same or different options).

If you call observe on the same target multiple times, it will replace the old options with the new options. It will not notify multiple times for the same change to the same target.

Panics

(JavaScript docs)

pub fn disconnect(&self)[src]

Stops observing all targets.

Until the observe method is called again, the MutationObserver will not be notified of any changes.

(JavaScript docs)

pub fn take_records(&self) -> Vec<MutationRecord>[src]

Empties the MutationObserver's record queue and returns what was in there.

This method is generally not needed, instead use the MutationObserver callback to respond to changes.

(JavaScript docs)

Trait Implementations

impl Drop for MutationObserverHandle[src]

impl Debug for MutationObserverHandle[src]

impl Deref for MutationObserverHandle[src]

type Target = MutationObserver

The resulting type after dereferencing.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]