hayate crate is the core transfer engine behind the Hayate CLI, and it is designed from the ground up to be embedded directly into your own Rust applications. If you need encrypted, high-performance LAN file transfers inside a desktop tool, background service, or custom workflow — without shelling out to an external process — adding hayate as a library dependency gives you full programmatic control over every stage of the transfer: connection establishment, consent, progress reporting, and error recovery.
Add the Dependency
Addhayate and the compio async runtime to your Cargo.toml:
Cargo.toml
Quick Example
The following sends a single file to a known receiver address using Direct Mode:Workspace Crates
Runtime Requirement
Hayate’s async APIs run inside acompio runtime. Annotate your async main with #[compio::main], or use compio::runtime::Runtime::new().unwrap().block_on(...) to drive async code from a synchronous context:
Crate Root Exports
The following types are re-exported at the crate root for convenience:
Full generated API documentation is available at docs.rs/hayate.
Next Steps
HayateSender
Build and configure a sender, set target or pairing code, and stream files or directories.
HayateReceiver
Bind a QUIC listener, handle consent callbacks, and save incoming transfers.
Error Handling
Match EngineError variants, cancel transfers mid-stream, and recover from failures.
Low-Level Modules
Access crypto, discovery, buffer pooling, and protocol internals directly.