Skip to content

blenderfreaky/rust-lib-reimpls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Groupchat

An overgrown university task. Originally this was going to simply be a chat-server from scratch, but I wanted to learn more about how serde and async-executors work internally, so I made basic implementations of both.

Project Structure

Notable (non-exhaustive) directories and files:

  • groupchat/src/bin/: Contains the executable targets
    • thread_server.rs: A thread-per-connection server implementation
    • async_server.rs: An async server implementation, using mio for I/O. Nearly identical to thread_server.rs, but with async I/O
    • event_server.rs: An event-driven server implementation
    • client.rs: The chat client implementation
  • groupchat/src/fmt/: Custom binary format implementation for efficient message serialization
    • framed.rs: Message framing implementation
  • exec/: Contains a basic work-stealing multithreaded executor implementation
    • mio.rs: A mio-based async I/O implementation for use with the executor
    • async_ch.rs Basic async channel implementations
  • serdy/: Core serialization framework (similar to serde)
  • serdy-derive/: Procedural macros for deriving serialization implementations

Quick Start

  1. Start a server (choose one):

    # Thread-per-connection server
    cargo run --bin thread_server
    
    # OR Event-driven server
    cargo run --bin event_server
  2. Connect with one or more clients:

    cargo run --bin client

The server will listen for incoming connections, and clients can send messages that will be broadcast to all connected clients.

See module documentation for more information.

Documentation

To view the full documentation with detailed explanations of the APIs and implementations, run:

cargo doc --open

This will build and open the documentation in your default web browser.

About

Basic reimplementation of serde and a work-stealing async executor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages