Crates.io | fake-socket |
lib.rs | fake-socket |
version | 0.2.0 |
source | src |
created_at | 2022-01-22 19:25:21.102255 |
updated_at | 2022-02-13 20:24:26.081252 |
description | A simple fake socket for testing purpose. |
homepage | https://github.com/tyrchen/utility-belt |
repository | https://github.com/tyrchen/utility-belt |
max_upload_size | |
id | 519277 |
size | 6,071 |
Usage:
use tokio::sync::mpsc;
use axum::extract::ws::Message;
let (_tx1, rx1) = mpsc::unbounded_channel();
let (tx2, mut rx2) = mpsc::unbounded_channel();
let socket = FakeSocket::<Message, axum::Error>::new(rx1, tx2);
// use it as a websocket in your test