Home
A transport-agnostic Rust client SDK for the Signal Fish multiplayer signaling protocol.
Key Features¶
- Transport-Agnostic — Plug in any transport that implements the
Transporttrait; swap WebSocket for TCP, QUIC, or a test loopback without changing your game code. - Async / Await — Built on Tokio with a fully non-blocking API. Command methods return immediately; events arrive on an async channel.
- Event-Driven Architecture — All server responses are delivered as strongly-typed
SignalFishEventvariants on a boundedmpscchannel — justmatchin a loop. - WebSocket Built-In —
WebSocketTransportships out of the box (enabled by default via thetransport-websocketfeature) so you can connect in one line. - Reconnection Support — Gracefully handle disconnects and reconnect to your session without losing context.
- Spectator Mode — Join rooms as a spectator to observe game state without participating.
- Configurable — Tune event channel capacity, shutdown timeout, and more via
SignalFishConfigbuilder methods.
Quick Start¶
Add the crate to your project:
Then connect, authenticate, and join a room in just a few lines:
use signal_fish_client::{
WebSocketTransport, SignalFishClient, SignalFishConfig,
JoinRoomParams, SignalFishEvent,
};
#[tokio::main]
async fn main() -> Result<(), signal_fish_client::SignalFishError> {
let transport = WebSocketTransport::connect("wss://example.com/signal").await?;
let config = SignalFishConfig::new("mb_app_abc123");
let (mut client, mut event_rx) = SignalFishClient::start(transport, config);
while let Some(event) = event_rx.recv().await {
match event {
SignalFishEvent::Authenticated { app_name, .. } => {
println!("Authenticated as {app_name}");
client.join_room(JoinRoomParams::new("my-game", "Alice"))?;
}
SignalFishEvent::RoomJoined { room_code, .. } => {
println!("Joined room {room_code}");
}
SignalFishEvent::Disconnected { .. } => break,
_ => {}
}
}
client.shutdown().await;
Ok(())
}
Feature flag
WebSocketTransport requires the transport-websocket feature, which is enabled by default. If you disabled default features, re-enable it explicitly:
Explore the Docs¶
-
Installation & Quick Start
Install the crate, set up Tokio, and make your first connection in under five minutes.
-
Client API Reference
Configuration, builder methods, and command reference for
SignalFishClient. -
Example Walkthroughs
Walkthroughs of real-world usage patterns — lobby management, custom transports, and more.
-
API Docs (docs.rs)
Auto-generated API documentation with full type signatures and doc comments.
Links¶
| Resource | URL |
|---|---|
| GitHub Repository | Ambiguous-Interactive/signal-fish-client-rust |
| Guide (GitHub Pages) | Signal Fish Client SDK |
| crates.io | signal-fish-client |
| docs.rs | signal-fish-client |
Built with :heart: by Ambiguous Interactive