Skip to main content

Crate zpl_toolchain_print_client

Crate zpl_toolchain_print_client 

Source
Expand description

ZPL Print Client — send ZPL to Zebra and ZPL-compatible printers.

Supports TCP (port 9100), USB, and serial/Bluetooth SPP transports. The core API is synchronous (std::net), with no async runtime required.

Structs§

BatchOptions
Options for batch printing operations.
BatchProgress
Progress report for batch printing.
BatchResult
Result of a batch print operation.
HostStatus
Parsed ~HS (Host Status) response.
JobId
Opaque identifier for a logical print job (single label or batch).
PrinterConfig
Complete printer configuration: timeouts + retry settings.
PrinterInfo
Parsed ~HI (Host Identification) response.
PrinterTimeouts
Timeout settings for printer connections.
ReconnectRetryPrinter
A retry wrapper that reconnects between attempts.
RetryConfig
Retry settings for transient failures.
RetryPrinter
A wrapper that adds retry-with-backoff to any Printer implementation.
TcpPrinter
A synchronous TCP connection to a ZPL printer.

Enums§

JobPhase
Lifecycle phase of a print job.
PrintError
Printer error conditions, categorized by type.
PrintMode
Zebra print mode, as reported in ~HS line 2 field 4.
PrinterErrorKind
Specific printer error conditions derived from ~HS status flags.

Traits§

Printer
Send data to a printer. All transports implement this.
Reconnectable
A printer that can re-establish its connection after a failure.
StatusQuery
Query printer status. Only bidirectional transports implement this.

Functions§

create_job_id
Generate a new unique job ID.
expected_frame_count
Determine the expected number of STX/ETX frames for a given command.
read_frames
Read exactly expected_count STX/ETX framed responses from a stream.
resolve_printer_addr
Resolve a user-provided printer address string to a SocketAddr.
send_batch
Send a batch of labels with optional progress reporting.
send_batch_with_status
Send a batch of labels with status polling (requires bidirectional transport).
wait_for_completion
Poll ~HS until the printer reports no formats in buffer and no labels remaining, or until the timeout elapses.