[−][src]Struct sauron::DomUpdater
Used for keeping a real DOM node up to date based on the current Node and a new incoming Node that represents our latest DOM state.
Fields
active_closures: HashMap<u32, Vec<(&'static str, Closure<dyn FnMut(Event) + 'static>)>, RandomState>
The closures that are currently attached to elements in the page.
We keep these around so that they don't get dropped (and thus stop working);
Implementations
impl<MSG> DomUpdater<MSG>
[src]
pub fn new(
current_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>,
mount: &Node
) -> DomUpdater<MSG>
[src]
current_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>,
mount: &Node
) -> DomUpdater<MSG>
Creates and instance of this DOM updater, but doesn't mount the current_vdom to the DOM just yet.
pub fn active_closure_len(&self) -> usize
[src]
count the total active closures regardless of which element it attached to.
impl<MSG> DomUpdater<MSG> where
MSG: 'static,
[src]
MSG: 'static,
pub fn append_to_mount<DSP>(&mut self, program: &DSP) where
DSP: Dispatch<MSG> + Clone + 'static,
[src]
DSP: Dispatch<MSG> + Clone + 'static,
Mount the current_vdom appending to the actual browser DOM specified in the root_node This also gets the closures that was created when mounting the vdom to their actual DOM counterparts.
pub fn replace_mount<DSP>(&mut self, program: &DSP) where
DSP: Dispatch<MSG> + Clone + 'static,
[src]
DSP: Dispatch<MSG> + Clone + 'static,
Mount the current_vdom replacing the actual browser DOM specified in the root_node This also gets the closures that was created when mounting the vdom to their actual DOM counterparts.
pub fn new_append_to_mount<DSP>(
program: &DSP,
current_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>,
mount: &Element
) -> DomUpdater<MSG> where
DSP: Dispatch<MSG> + Clone + 'static,
[src]
program: &DSP,
current_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>,
mount: &Element
) -> DomUpdater<MSG> where
DSP: Dispatch<MSG> + Clone + 'static,
Create a new DomUpdater
.
A root Node
will be created and appended (as a child) to your passed
in mount element.
pub fn new_replace_mount<DSP>(
program: &DSP,
current_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>,
mount: Element
) -> DomUpdater<MSG> where
DSP: Dispatch<MSG> + Clone + 'static,
[src]
program: &DSP,
current_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>,
mount: Element
) -> DomUpdater<MSG> where
DSP: Dispatch<MSG> + Clone + 'static,
Create a new DomUpdater
.
A root Node
will be created and it will replace your passed in mount
element.
pub fn update_dom<DSP>(
&mut self,
program: &DSP,
new_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>
) where
DSP: Dispatch<MSG> + Clone + 'static,
[src]
&mut self,
program: &DSP,
new_vdom: Node<&'static str, &'static str, &'static str, AttributeValue, Event, MSG>
) where
DSP: Dispatch<MSG> + Clone + 'static,
Diff the current virtual dom with the new virtual dom that is being passed in.
Then use that diff to patch the real DOM in the user's browser so that they are seeing the latest state of the application.
pub fn map_msg<F, MSG2>(self, func: F) -> DomUpdater<MSG2> where
F: Fn(MSG) -> MSG2 + 'static,
MSG2: 'static,
[src]
F: Fn(MSG) -> MSG2 + 'static,
MSG2: 'static,
map this DomUpdater such that the Node
pub fn root_node(&self) -> Node
[src]
Return the root node of your application, the highest ancestor of all other nodes in your real DOM tree.
Auto Trait Implementations
impl<MSG> !RefUnwindSafe for DomUpdater<MSG>
impl<MSG> !Send for DomUpdater<MSG>
impl<MSG> !Sync for DomUpdater<MSG>
impl<MSG> Unpin for DomUpdater<MSG>
impl<MSG> !UnwindSafe for DomUpdater<MSG>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow(&self) -> &TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut TⓘNotable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
[src]
Notable traits for &'_ mut R
impl<'_, R> Read for &'_ mut R where
R: Read + ?Sized, impl<'_, W> Write for &'_ mut W where
W: Write + ?Sized, impl<'_, F> Future for &'_ mut F where
F: Unpin + Future + ?Sized, type Output = <F as Future>::Output;impl<'_, I> Iterator for &'_ mut I where
I: Iterator + ?Sized, type Item = <I as Iterator>::Item;
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,