# sender.rs — Outgoing Packet Sender

<p class="callout warning">This file is work in progress</p>

`<span class="editor-theme-code">send_envelope()</span>`<span style="white-space: pre-wrap;"> is the single outgoing send function. It takes a </span>`<span class="editor-theme-code">PbEnvelope</span>`<span style="white-space: pre-wrap;">, encodes it to bytes using prost, and sends it to the target address over UDP. A </span>`<span class="editor-theme-code">hex_dump()</span>`<span style="white-space: pre-wrap;"> helper (currently commented out) can be re-enabled to log outgoing packet bytes for debugging.</span>

Usage pattern in any command:

```rust
sender::send_envelope(&socket, "192.168.1.x:9000", envelope).await?;
```