[][src]Struct moxie_dom::embed::WebRuntime

#[must_use]
pub struct WebRuntime { /* fields omitted */ }

Wrapper around moxie::embed::Runtime which provides an Env for building trees of DOM nodes.

Methods

impl WebRuntime[src]

pub fn new(parent: impl Into<Node>, root: impl FnMut() + 'static) -> Self[src]

Construct a new WebRuntime which will maintain the children of the provided parent.

On its own, a WebRuntime is inert and must either have its run_once method called when a re-render is needed, or be scheduled with WebRuntime::animation_frame_scheduler.

pub fn run_once(&mut self)[src]

Run the root function in a fresh moxie::Revision. See moxie::embed::Runtime::run_once for details.

impl WebRuntime[src]

pub fn in_web_div(root: impl FnMut() + 'static) -> (Self, Element)[src]

Create a new div and use that as the parent node for the runtime with which it is returned.

pub fn animation_frame_scheduler(self) -> AnimationFrameScheduler<Self>[src]

Pass ownership of this runtime to a "loop" which runs with requestAnimationFrame.

impl WebRuntime[src]

pub fn in_rsdom_div(root: impl FnMut() + 'static) -> (Self, Rc<VirtNode>)[src]

Create a new virtual div and use that as the parent node for the runtime with which it is returned.

Trait Implementations

impl Tick for WebRuntime[src]

impl Waking for WebRuntime[src]

Auto Trait Implementations

impl !RefUnwindSafe for WebRuntime

impl !Send for WebRuntime

impl !Sync for WebRuntime

impl Unpin for WebRuntime

impl !UnwindSafe for WebRuntime

Blanket Implementations

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

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

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

impl<T> Erased for T

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

impl<T, U> Into<U> for T where
    U: From<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.