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

#1885 in Web programming

Download history 334/week @ 2024-07-23 277/week @ 2024-07-30 201/week @ 2024-08-06 67/week @ 2024-08-13 199/week @ 2024-08-20 227/week @ 2024-08-27 148/week @ 2024-09-03 229/week @ 2024-09-10 162/week @ 2024-09-17 209/week @ 2024-09-24 143/week @ 2024-10-01 175/week @ 2024-10-08 293/week @ 2024-10-15 489/week @ 2024-10-22 367/week @ 2024-10-29 348/week @ 2024-11-05

1,507 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–16MB
~209K SLoC