{"id":15762360,"url":"https://github.com/williamvenner/viaduct","last_synced_at":"2026-02-14T22:34:13.967Z","repository":{"id":53877780,"uuid":"521783255","full_name":"WilliamVenner/viaduct","owner":"WilliamVenner","description":"A duplex communication channel between a parent and child process, using unnamed pipes","archived":false,"fork":false,"pushed_at":"2022-08-13T21:13:16.000Z","size":116,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-11T11:33:27.255Z","etag":null,"topics":["communication","duplex","ipc","multiprocess","multiprocessing","pipe","pipes","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/viaduct","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WilliamVenner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-05T21:44:39.000Z","updated_at":"2023-09-14T07:12:39.000Z","dependencies_parsed_at":"2022-08-13T03:11:01.903Z","dependency_job_id":null,"html_url":"https://github.com/WilliamVenner/viaduct","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fviaduct","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fviaduct/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fviaduct/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WilliamVenner%2Fviaduct/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WilliamVenner","download_url":"https://codeload.github.com/WilliamVenner/viaduct/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243478362,"owners_count":20297242,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["communication","duplex","ipc","multiprocess","multiprocessing","pipe","pipes","rust"],"created_at":"2024-10-04T11:08:49.679Z","updated_at":"2026-02-14T22:34:13.936Z","avatar_url":"https://github.com/WilliamVenner.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![crates.io](https://img.shields.io/crates/v/viaduct.svg)](https://crates.io/crates/viaduct)\n[![docs.rs](https://docs.rs/viaduct/badge.svg)](https://docs.rs/viaduct/)\n[![license](https://img.shields.io/crates/l/viaduct)](https://github.com/WilliamVenner/viaduct/blob/master/LICENSE)\n\nViaduct is a library for establishing a duplex communication channel between a parent and child process, using unnamed pipes.\n\n# Example\n\n## Shared library\n\n```rust\n#[derive(Serialize, Deserialize)]\npub enum ExampleRpc {\n    Cow,\n    Pig,\n    Horse\n}\n\n#[derive(Serialize, Deserialize)]\npub enum ExampleRequest {\n    DoAFrontflip,\n    DoABackflip,\n}\n\n#[derive(Serialize, Deserialize, PartialEq, Eq)]\npub struct FrontflipError;\n\n#[derive(Serialize, Deserialize, PartialEq, Eq)]\npub struct BackflipError;\n```\n\n## Parent process\n\n```rust\nlet child = std::process::Command::new(\"child.exe\");\nlet ((tx, rx), mut child) = ViaductParent::new(child).unwrap().build().unwrap();\n\nstd::thread::spawn(move || {\n    rx.run(\n        |rpc: ExampleRpc| match rpc {\n            ExampleRpc::Cow =\u003e println!(\"Moo\"),\n            ExampleRpc::Pig =\u003e println!(\"Oink\"),\n            ExampleRpc::Horse =\u003e println!(\"Neigh\"),\n        },\n\n        |request: ExampleRequest, tx| match request {\n            ExampleRequest::DoAFrontflip =\u003e {\n                println!(\"Doing a frontflip!\");\n                tx.respond(Ok::\u003c_, FrontflipError\u003e(())).unwrap();\n            },\n\n            ExampleRequest::DoABackflip =\u003e {\n                println!(\"Doing a backflip!\");\n                tx.respond(Ok::\u003c_, BackflipError\u003e(())).unwrap();\n            },\n        },\n    ).unwrap();\n});\n\ntx.rpc(ExampleRpc::Cow).unwrap();\ntx.rpc(ExampleRpc::Pig).unwrap();\ntx.rpc(ExampleRpc::Horse).unwrap();\n\nlet response: Result\u003c(), FrontflipError\u003e = tx.request(ExampleRequest::DoAFrontflip).unwrap();\nassert_eq!(response, Ok(()));\n```\n\n## Child process\n\n```rust\nlet (tx, rx) = unsafe { ViaductChild::new() }.unwrap();\n\nstd::thread::spawn(move || {\n    rx.run(\n        |rpc: ExampleRpc| match rpc {\n            ExampleRpc::Cow =\u003e println!(\"Moo\"),\n            ExampleRpc::Pig =\u003e println!(\"Oink\"),\n            ExampleRpc::Horse =\u003e println!(\"Neigh\"),\n        },\n\n        |request: ExampleRequest, tx| match request {\n            ExampleRequest::DoAFrontflip =\u003e {\n                println!(\"Doing a frontflip!\");\n                tx.respond(Ok::\u003c_, FrontflipError\u003e(())).unwrap();\n            },\n\n            ExampleRequest::DoABackflip =\u003e {\n                println!(\"Doing a backflip!\");\n                tx.respond(Ok::\u003c_, BackflipError\u003e(())).unwrap();\n            },\n        },\n    ).unwrap();\n});\n\ntx.rpc(ExampleRpc::Horse).unwrap();\ntx.rpc(ExampleRpc::Pig).unwrap();\ntx.rpc(ExampleRpc::Cow).unwrap();\n\nlet response: Result\u003c(), BackflipError\u003e = tx.request(ExampleRequest::DoABackflip).unwrap();\nassert_eq!(response, Ok(()));\n```\n\n# Use Cases\n\nViaduct was designed for separating user interface from application logic in a cross-platform manner.\n\nFor example, an application may want to run a GUI in a separate process from the application logic, for modularity or performance reasons.\n\nViaduct allows for applications like this to communicate between these processes in a natural way, without having to manually implement IPC machinery \u0026 synchronization.\n\n# Usage\n\nCheck out [the documentation](https://docs.rs/viaduct/) for usage information.\n\n# License\n\nViaduct is licensed under the MIT license or the Apache License v2.0, at your choice.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fviaduct","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilliamvenner%2Fviaduct","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilliamvenner%2Fviaduct/lists"}