Parent
Architecture review (2026-06-21). Slice 4 of 6 from the deepening series. Documented at server/usbip-server/src/discovery.rs, client/usbip-client/src/discovery.rs, and server/usbip-server/src/api.rs:100-103.
What to build
The wire format for mDNS TXT records is encoded in server/usbip-server/src/discovery.rs (encode_devices_txt + 3 tests) and decoded in client/usbip-client/src/discovery.rs (decode_devices_txt + 0 tests). Two implementations of one wire format with no shared contract. The future Kotlin client will be the third.
Lift both into a new usbip_core::discovery_txt module. Server encodes via that module. Client decodes via that module. Treat the wire format as a contract with golden fixtures. Add a #[doc(hidden)] const TXT_FORMAT_V1: &[u8] = ... so the format version is visible at the call site.
This is the smallest, highest-leverage contract change. Once shared, the Kotlin client cannot drift from the Rust encoder.
Acceptance criteria
Blocked by
Parent
Architecture review (2026-06-21). Slice 4 of 6 from the deepening series. Documented at
server/usbip-server/src/discovery.rs,client/usbip-client/src/discovery.rs, andserver/usbip-server/src/api.rs:100-103.What to build
The wire format for mDNS TXT records is encoded in
server/usbip-server/src/discovery.rs(encode_devices_txt+ 3 tests) and decoded inclient/usbip-client/src/discovery.rs(decode_devices_txt+ 0 tests). Two implementations of one wire format with no shared contract. The future Kotlin client will be the third.Lift both into a new
usbip_core::discovery_txtmodule. Server encodes via that module. Client decodes via that module. Treat the wire format as a contract with golden fixtures. Add a#[doc(hidden)] const TXT_FORMAT_V1: &[u8] = ...so the format version is visible at the call site.This is the smallest, highest-leverage contract change. Once shared, the Kotlin client cannot drift from the Rust encoder.
Acceptance criteria
usbip-core/src/discovery_txt.rswithpub fn encode(devices: &[DeviceDescriptor]) -> Stringandpub fn decode(txt: &str) -> Result<Vec<DeviceDescriptor>, DiscoveryTxtError>encode_devices_txtbecomes a thin re-export or is deleteddecode_devices_txtbecomes a thin re-export or is deletedtests/fixtures/discovery_txt/contains a golden TXT file and the test asserts byte-for-byte encoding stabilitycargo test --workspace --releasepasses;cargo clippy --workspace -- -D warningscleanBlocked by