5 releases

0.2.3 Feb 12, 2024
0.2.2 Dec 20, 2023
0.2.1 Dec 12, 2023
0.2.0 Dec 12, 2023
0.1.0 Dec 12, 2023

#2384 in Web programming

Download history 116/week @ 2025-04-26 159/week @ 2025-05-03 218/week @ 2025-05-10 61/week @ 2025-05-17 65/week @ 2025-05-24 128/week @ 2025-05-31 162/week @ 2025-06-07 328/week @ 2025-06-14 80/week @ 2025-06-21 57/week @ 2025-06-28 78/week @ 2025-07-05 65/week @ 2025-07-12 62/week @ 2025-07-19 54/week @ 2025-07-26 46/week @ 2025-08-02 48/week @ 2025-08-09

221 downloads per month
Used in patternfly-yew

Apache-2.0

10KB
186 lines

web-tools

Tools for web programming in Rust.

Rationale

Rust has a strict type system, which is great. But sometimes it's just convenient to use:

use web_tools::prelude::*;

#[cfg(feature = "yew")]
fn yew(node: &yew::prelude::NodeRef) {
    node.focus();
}

fn vanilla(element: &web_sys::Element) {
    element.focus();
}

Functionality

  • Optimistic traits: execute some function on an element, if it supports it … or do nothing.
  • Iterators for things that should be iterable, but don't implement IntoIterator.

web-tools

crates.io docs.rs

Tools for the Web

Usage

Add it to your project:

cargo add web-tools

Rationale

Rust has a strict type system, which is great. But sometimes it's just convenient to use:

use web_tools::prelude::*;

fn callback(node: &NodeRef) {
    node.focus();
}

Functionality

  • Optimistic traits: execute some function on an element, if it supports it … or do nothing.
  • Iterators for things that should be iterable, but don't implement IntoIterator.

Dependencies

~7–18MB
~242K SLoC