Skip to main content

Crate dartboard_local

Crate dartboard_local 

Source
Expand description

In-process dartboard server + LocalClient.

The server owns the canonical Canvas, assigns globally monotonic sequence numbers, and fans out ServerMsgs to connected clients. Each LocalClient is a handle scoped to one session. Other transports can integrate by implementing ServerSink and using ServerHandle::register_transport.

Re-exports§

pub use store::CanvasStore;
pub use store::InMemStore;

Modules§

store

Structs§

Hello
Introductory payload a client sends before any ops. Name is echoed back to peers; color is a transport-level hint and may be replaced by the server’s configured ColorSelectionMode.
LocalClient
In-process client handle. Sends ops directly into the server under the shared state lock; receives events over a std mpsc channel.
ServerHandle
A handle to the running server. Cloneable; every clone references the same canonical canvas and client registry.

Enums§

ColorSelectionMode
Policy for assigning per-user colors on connect.
ConnectOutcome
Outcome of a connect attempt. Rejected connections leave no registered state on the server.

Constants§

MAX_PLAYERS
Max concurrent players on a single shared canvas. Equal to the palette length so the seat cap preserves unique per-user colors.

Traits§

ServerSink
Minimal transport-facing sink used by the server to fan out ServerMsgs.