Crate musli_web

Crate musli_web 

Source
Expand description

github crates.io docs.rs

This crate provides a set of utilities for working with various web-based APIs and Müsli.

It includes support for:

  • axum Json integration, allowing you to use Müsli for serialization and deserialization in your Axum applications.
  • axum ws::Server integration, allowing you to build the server side of the websocket protocol this crate implements.
  • yew integration, allowing you to use Müsli for communicating with websocket clients using a well-defined API.

Note that the organization of the modules include the version of the corresponding crate. Unstable versions are prefixed with 0, such as yew022.

See the following modules for how to use:


§Examples

  • api is the example crate which defines API types shared between server and client.
  • server is the axum-based server implementation.
  • client is the yew client communicating with the server.

You can run the client like this:

cd examples/client && trunk serve

You can run the server like this:

cd examples/server && cargo run

Modules§

apiapi
Shared traits for defining API types.
axum08axum08
The server implementation for axum.
webweb03
The generic web implementation.
web03web03
Client side implementation for web-sys 0.3.x.
wsws
The server side of the websocket protocol.
yew021yew021
Integration with yew 0.21.x.
yew022yew022
Integration with yew 0.22.x.

Structs§

Jsonjson and alloc
Encode the given value as JSON.