ping-proto
Simple ASCII PING/PONG protocol implementation.
Features
- PING request encoding (
PING\r\n) - PONG response parsing (both
PONG\r\nand RESP-style+PONG\r\n) - Error response parsing (
-ERR ...\r\n)
Usage
[]
= "0.0.1"
use ;
// Encode a PING request
let mut buf = ;
let len = Ping.encode;
assert_eq!;
// Parse a PONG response
let data = b"PONG\r\n";
let = parse.unwrap;
assert_eq!;
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.