Lace examples

Rust Tokio TCP + filesystem stores

This example is the Rust first-release path: two Tokio runtime Laces use native filesystem stores, converge over raw TCP/ILTP, and then read the selected records from the client store with ordinary Lace porcelain.

It demonstrates the final application shape without laced:

The native filesystem store uses a sparse mmap-backed records arena plus positional writes and a descriptor-held OS lock at stable path lock. Process death releases ownership; ordinary reopen recovers the committed prefix. It is available on local filesystems on Unix targets, including macOS, and on Windows. Targets without native mmap, positional-write, or locking support fail clearly at store open.

Run

From the repository root:

cargo run --manifest-path examples/rust-tokio-tcp-fs/Cargo.toml

Expected output includes:

server stored records: 3
client listed selected: item/server-one, item/server-two
unrelated selected: no

The example writes fresh stores under:

target/tmp/rust-tokio-tcp-fs/server
target/tmp/rust-tokio-tcp-fs/client

Policy

policy/items.interlang selects only records under Group=quickstart, App=rust-tokio-tcp-fs, and Name=item/{*}:

converge {
  Item in //quickstart//rust-tokio-tcp-fs//item/{*} => include Item
}

The unrelated record is present in the server store, but it is not advertised, requested, transferred, or listed by this policy.