Registry / Library

library · v0.1.0
Netstring Stream
Read length-prefixed binary messages across arbitrary input boundaries with a caller-supplied payload limit.
Use Netstring Stream
use vendor::netstring_stream::netstring_stream;
Run the example
nest demo netstring_stream@0.1.0
blyxc native-run netstring_stream-demo/main.blyx
Example source and expected output
use vendor::netstring_stream::netstring_stream;
fn main() {
let head = netstring_step(netstring_start(), 49.0, 64.0);
let body = netstring_step(head, 58.0, 64.0);
let payload = netstring_step(body, 65.0, 64.0);
println!(at(payload, 2));
let done = netstring_step(payload, 44.0, 64.0);
println!(at(done, 2));
println!(netstring_complete(done));
}
Expected output
1
2
true
Published versions
| Version | Package | Source commit | SHA-256 |
|---|---|---|---|
| 0.1.0 | Download ZIP · Browse files | 2dfff82a38 | 090c9a6d4541db1a74771c9e2beb5295bab06c3c485ea636a6920cd54a7bcfb3 |