zpl_toolchain_print_client
Send ZPL to Zebra and ZPL-compatible label printers over TCP, USB, or serial/Bluetooth SPP.
Part of the zpl-toolchain project.
Features
- Three transports: TCP (port 9100, default), USB (
nusb, feature-gated), Serial/BT SPP (serialport, feature-gated) - Split trait design:
Printer(send-only) +StatusQuery(bidirectional) - Status parsing:
~HS→HostStatus(24 fields),~HI→PrinterInfo - Batch printing:
send_batch()/send_batch_with_status()with progress callbacks andControlFlowabort;wait_for_completion()generic polling - Retry with backoff:
RetryPrinter<P>wrapper with exponential backoff and jitter;ReconnectRetryPrinter<P>for automatic reconnection between retry attempts - Semver-safe:
#[non_exhaustive]on all public structs and enums - Synchronous: No async runtime required — uses
std::netandstd::io
Quick Start
use ;
let config = default;
let mut printer = connect?;
// Send a label
printer.send_zpl?;
// Query printer status
let status = printer.query_status?;
println!;
Feature Flags
| Feature | Default | Description |
|---|---|---|
tcp |
Yes | TCP transport via socket2 |
serde |
Yes | Serialize/Deserialize for HostStatus, PrinterInfo, PrintMode |
usb |
No | USB transport via nusb |
serial |
No | Serial/Bluetooth SPP via serialport |
Transport-only (no serde) for minimal builds:
= { = "0.1", = false, = ["tcp"] }
With all transports and serde:
= "0.1" # TCP + serde
= { = "0.1", = ["usb", "serial"] } # All transports + serde
Documentation
See the Print Client Guide for comprehensive usage, CLI integration, and troubleshooting.
License
Dual-licensed under MIT or Apache-2.0.