Module optimistic

Source
Expand description

Optimistic operations

In may cases, Web APIs in Rust return Result or Option and enforce strict types. Then again in JavaScript-land one can simply call .focus() on something and it works, breaks, or does nothing. But the code looks a bit simpler.

Optimistic traits bring part of this to Rust. Functions on yew::prelude::NodeRef just work, or fail silently.

Traitsยง

OptimisticElement
Support working with web_sys::Element
OptimisticHtmlElement
Support working with web_sys::HtmlElement
OptimisticHtmlFormElement
Support working with web_sys::HtmlFormElement
OptimisticHtmlInputElement
Support working with web_sys::HtmlInputElement