web_tools/
lib.rs

1//! # web-tools
2//!
3//! Tools for web programming in Rust.
4//!
5//! ## Rationale
6//!
7//! Rust has a strict type system, which is great. But sometimes it's just convenient to use:
8//!
9//! ```rust
10//! use web_tools::prelude::*;
11//!
12//! #[cfg(feature = "yew")]
13//! fn yew(node: &yew::prelude::NodeRef) {
14//!     node.focus();
15//! }
16//!
17//! fn vanilla(element: &web_sys::Element) {
18//!     element.focus();
19//! }
20//! ```
21//!
22//! ## Functionality
23//!
24//! * Optimistic traits: execute some function on an element, if it supports it … or do nothing.
25//! * Iterators for things that should be iterable, but don't implement `IntoIterator`.
26
27pub mod iter;
28pub mod optimistic;
29pub mod prelude;