docs.rs failed to build windows_shared_memory-0.1.5
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.
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.
Windows Shared Memory
Windows IPC library using shared memory. Supports 32-bit/64-bit cross-process communication.
Installation
[]
= "0.1.5"
Usage
use ;
// Server
let server = new.unwrap;
server.send.unwrap;
if let Message = server.receive
// Client (separate process)
let client = new.unwrap;
if let Message = client.receive
client.send.unwrap;
Custom path:
let server = new.unwrap;
let client = new.unwrap;
Custom Buffer Size
// Server with 64KB buffer
let server = with_buffer_size.unwrap;
// Client auto-detects buffer size from server
let client = new.unwrap;
println!;
API
| Method | Description |
|---|---|
Server::new(path) |
Create server (16KB) |
Server::with_buffer_size(path, size) |
Create with custom buffer |
Client::new(path) |
Connect to server |
send(&[u8]) |
Send data |
receive(timeout_ms) |
Receive as String |
receive_bytes(timeout_ms) |
Receive as bytes |
buffer_size() |
Get buffer size |
server.send_close() |
Close signal |
ReceiveMessage: Message(String), Timeout, Exit, MessageError(String)
vs winmmf
| windows_shared_memory | winmmf | |
|---|---|---|
| Design | Server-Client IPC | Generic MMF wrapper |
| Sync | Windows Events (blocking) | Spin lock (busy-wait) |
| Direction | Bidirectional (separate buffers) | Unidirectional |
| Dependencies | windows only |
4 crates |
| Use case | Message passing | Data storage for share |
License
MIT