yew_stdweb::app

Struct App

Source
pub struct App<COMP: Component> { /* private fields */ }
Expand description

An instance of an application.

Implementations§

Source§

impl<COMP> App<COMP>
where COMP: Component, COMP::Properties: Default,

Source

pub fn mount(self, element: Element) -> ComponentLink<COMP>

The main entry point of a Yew program. It works similarly to the program function in Elm. You should provide an initial model, update function which will update the state of the model and a view function which will render the model to a virtual DOM tree. If you would like to pass props, use the mount_with_props method.

Source

pub fn mount_to_body(self) -> ComponentLink<COMP>

Alias to mount("body", ...).

Source

pub fn mount_as_body(self) -> ComponentLink<COMP>

Alternative to mount which replaces the body element with a component which has a body element at the root of the HTML generated by its view method. Use this method when you need to manipulate the body element. For example, adding/removing app-wide CSS classes of the body element.

Source§

impl<COMP> App<COMP>
where COMP: Component,

Source

pub fn new() -> Self

Creates a new App with a component in a context.

Source

pub fn mount_with_props( self, element: Element, props: COMP::Properties, ) -> ComponentLink<COMP>

The main entry point of a Yew program which also allows passing properties. It works similarly to the program function in Elm. You should provide an initial model, update function which will update the state of the model and a view function which will render the model to a virtual DOM tree.

Source

pub fn mount_to_body_with_props( self, props: COMP::Properties, ) -> ComponentLink<COMP>

Alias to mount_with_props("body", ...).

Source

pub fn mount_as_body_with_props( self, props: COMP::Properties, ) -> ComponentLink<COMP>

Alternative to mount_with_props which replaces the body element with a component which has a body element at the root of the HTML generated by its view method. Use this method when you need to manipulate the body element. For example, adding/removing app-wide CSS classes of the body element.

Trait Implementations§

Source§

impl<COMP: Debug + Component> Debug for App<COMP>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<COMP> Default for App<COMP>
where COMP: Component,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<COMP> Freeze for App<COMP>

§

impl<COMP> !RefUnwindSafe for App<COMP>

§

impl<COMP> !Send for App<COMP>

§

impl<COMP> !Sync for App<COMP>

§

impl<COMP> Unpin for App<COMP>

§

impl<COMP> !UnwindSafe for App<COMP>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, V> IntoOptPropValue<V> for T
where T: IntoPropValue<Option<V>>,

Source§

fn into_opt_prop_value(self) -> Option<V>

Convert self to an optional value of a Properties struct.
Source§

impl<T> IntoPropValue<Option<T>> for T

Source§

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Source§

impl<T> IntoPropValue<T> for T

Source§

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Any for T
where T: Any,