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

#1964 in Web programming

Download history 155/week @ 2024-03-14 64/week @ 2024-03-21 103/week @ 2024-03-28 165/week @ 2024-04-04 333/week @ 2024-04-11 373/week @ 2024-04-18 161/week @ 2024-04-25 99/week @ 2024-05-02 134/week @ 2024-05-09 177/week @ 2024-05-16 128/week @ 2024-05-23 217/week @ 2024-05-30 347/week @ 2024-06-06 370/week @ 2024-06-13 376/week @ 2024-06-20 258/week @ 2024-06-27

1,378 downloads per month
Used in patternfly-yew

Apache-2.0

10KB
186 lines

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.

lib.rs:

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.

Dependencies

~7–10MB
~198K SLoC