Struct dioxus_web::Config

source ·
pub struct Config { /* private fields */ }
Expand description

Configuration for the WebSys renderer for the Dioxus VirtualDOM.

This struct helps configure the specifics of hydration and render destination for WebSys.

Example

dioxus_web::launch(App, Config::new().hydrate(true).root_name("myroot"))

Implementations§

source§

impl Config

source

pub fn new() -> Self

Create a new Default instance of the Config.

This is no different than calling Config::default()

source

pub fn rootname(self, name: impl Into<String>) -> Self

Set the name of the element that Dioxus will use as the root.

This is akin to calling React.render() on the element with the specified name.

source

pub fn with_string_cache(self, cache: Vec<String>) -> Self

Sets a string cache for wasm bindgen to intern. This can help reduce the time it takes for wasm bindgen to pass strings from rust to javascript. This can significantly improve pefromance when passing strings to javascript, but can have a negative impact on startup time.

Currently this cache is only used when creating static elements and attributes.

source

pub fn with_default_panic_hook(self, f: bool) -> Self

Set whether or not Dioxus should use the built-in panic hook or defer to your own.

The panic hook is set to true normally so even the simplest apps have helpful error messages.

Trait Implementations§

source§

impl Default for Config

source§

fn default() -> Self

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.