[−][src]Struct stdweb::web::MutationObserverHandle
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]
&self,
target: &T,
options: MutationObserverInit
) -> Result<(), TODO>
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
-
At least one of
child_list
,attributes
, orcharacter_data
must betrue
. -
If
attribute_old_value
istrue
, thenattributes
must betrue
. -
If
character_data_old_value
istrue
, thencharacter_data
must betrue
. -
If
attribute_filter
isSome
, thenattributes
must betrue
.
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.
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.
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.
fn deref(&self) -> &Self::Target
[src]
Auto Trait Implementations
impl Send for MutationObserverHandle
impl Sync for MutationObserverHandle
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,