Skip to main content

Module file

Module file 

Source
Available on crate features transport-file and transport only.
Expand description

§File Transport

NDJSON (newline-delimited JSON) file transport for debugging, audit trails, and replay. Wraps async file I/O behind the Transport traits.

§Send

Appends one NDJSON line per send() call to the configured file path.

§Receive

Reads NDJSON lines from the file, tracking byte offset for commit. Position is persisted to a .pos sidecar file so reads survive restarts.

§Example

use hyperi_rustlib::transport::file::{FileTransport, FileTransportConfig};

let config = FileTransportConfig { path: "/tmp/events.ndjson".into(), append: true, ..Default::default() };
let transport = FileTransport::new(&config).await?;
transport.send("events", bytes::Bytes::from_static(b"{\"msg\":\"hello\"}")).await;

Structs§

FileToken
Commit token for file transport.
FileTransport
NDJSON file transport.
FileTransportConfig
Configuration for file transport.