icb

Crates.ioicb
lib.rsicb
version0.2.2
sourcesrc
created_at2020-01-21 20:33:15.319718
updated_at2020-02-23 20:08:02.636695
descriptionsmall library for writing ICB clients
homepage
repositoryhttps://github.com/jasperla/icb-rs
max_upload_size
id200874
size25,286
Jasper Lievisse Adriaanse (jasperla)

documentation

README

icb

crates.io

Simple and small library for writing ICB clients

Usage

Add to Cargo.toml:

[dependencies]
icb = "0.2"

In your main.rs or lib.rs you'll want to provide the connection parameters through a Config struct and use the init() function to create a Client and Server.

The server-component provides a run() function which is its main event loop. In order for the client to send and receive messages and commands it needs its own loop and communicate with the server via the msg_r: Receiver<Icbmsg> and cmd_s: Sender<Command>. A working example can be found in the icb-client crate.

use icb::Config;

fn main() {
    let config = Config {
        nickname: String::from("jasper"),
        serverip: "192.168.115.245",
        port: 7326,
	group: "slackers",
    };

    let (client, mut server) = icb::init(config).unwrap();
}

Note that the Server does not implement an ICB server, it is the component inside the icb library responsible for communicating with the remote server.

ICB

Protocol documentation for ICB can be found here.

Commit count: 86

cargo fmt