mail_slot 0.1.2

A Rust implementation of the Windows Mailslot API
docs.rs failed to build mail_slot-0.1.2
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: mail_slot-0.1.3

mail_slot

A Rust implementation of the Windows Mailslot API

Usage

The mailslot api is a Single Consumer Multiple Sender IPC system natively supported by windows. A single server can listen to a mail slot and any number of clients. Below is a naive example that counts to 10, printing the numbers to the terminal.

use mail_slot::{MailslotName, MailslotServer, MailslotClient};
let name = MailslotName::local("naive");
let mut server = MailslotServer::new(&name).unwrap();
let mut client = MailslotClient::new(&name).unwrap();
for i in 0..10 {
    client.send_message(i.to_string().as_bytes()).unwrap();
}
while let Some(msg) = server.get_next_unread().unwrap() {
    let msg_str = String::from_utf8(msg).unwrap();
    println!("message from client {}", msg_str);
}