{"id":29194631,"url":"https://github.com/krypt0nn/ioserverlib","last_synced_at":"2026-03-15T02:37:25.951Z","repository":{"id":300460632,"uuid":"1006253960","full_name":"krypt0nn/ioserverlib","owner":"krypt0nn","description":"rust library for IO-based message communication (IPC)","archived":false,"fork":false,"pushed_at":"2025-06-21T20:52:34.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-21T21:02:45.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krypt0nn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-21T20:52:16.000Z","updated_at":"2025-06-21T20:52:38.000Z","dependencies_parsed_at":"2025-06-21T21:02:48.315Z","dependency_job_id":"088ad338-f588-43f6-ab3b-59f3cde0ac31","html_url":"https://github.com/krypt0nn/ioserverlib","commit_stats":null,"previous_names":["krypt0nn/ioserverlib"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/krypt0nn/ioserverlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fioserverlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fioserverlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fioserverlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fioserverlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krypt0nn","download_url":"https://codeload.github.com/krypt0nn/ioserverlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krypt0nn%2Fioserverlib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263072012,"owners_count":23409260,"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":[],"created_at":"2025-07-02T04:05:57.688Z","updated_at":"2026-03-15T02:37:25.918Z","avatar_url":"https://github.com/krypt0nn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ioserverlib\n\nioserverlib is a rust library for IO-based message communication. It provides\na general framework for building client-server applications with customizable\nmessages serialization and deserialization and communication channels over\nstandard `Read` and `Write` traits, including unix sockets. This library is\nmeant to simplify implementation of custom IPC protocols.\n\n## Example\n\nThe example demonstrates how to spawn a server binary as a child process of the\nclient binary and communicate with it using standard input/output streams.\n\n```rust\nuse std::process::Command;\n\nuse ioserverlib::prelude::*;\nuse ioserverlib::server::Server;\n\n#[derive(Debug, serde::Serialize, serde::Deserialize)]\nenum Message {\n    Ping,\n    Pong\n}\n\nstruct Serializer;\n\nimpl JsonSerializer for Serializer {\n    type Error = Box\u003cdyn std::error::Error\u003e;\n    type Message = Message;\n}\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    let mut args = std::env::args().skip(1);\n\n    match args.next().as_deref() {\n        Some(\"client\") =\u003e {\n            let mut command = Command::new(std::env::current_exe()?);\n\n            let command = command.arg(\"server\");\n\n            let (mut child, mut channel) = ioserverlib::client::process_stdio(command, Serializer)?;\n\n            channel.write(Message::Ping)?;\n\n            dbg!(channel.read()?);\n\n            child.kill()?;\n        }\n\n        Some(\"server\") =\u003e {\n            let channel = ioserverlib::channel::stdio(Serializer);\n\n            let mut server = Server::new(channel, |message| {\n                match message {\n                    Message::Ping =\u003e Some(Message::Pong),\n                    Message::Pong =\u003e None\n                }\n            });\n\n            loop {\n                if let Err(err) = server.update() {\n                    eprintln!(\"server error: {err}\");\n                }\n            }\n        }\n\n        Some(command) =\u003e eprintln!(\"unknown command: {command}\"),\n        _ =\u003e eprintln!(\"missing command: client or server\")\n    }\n\n    Ok(())\n}\n```\n\n\u003e $ cargo run \\-\\- client\n\u003e\n\u003e [src/main.rs:32:13] channel.read()? = Pong\n\n\u003e $ echo '\"Ping\"' | cargo run \\-\\- server\n\u003e\n\u003e \"Pong\"\n\nAuthor: [Nikita Podvirnyi](https://github.com/krypt0nn)\\\nLicensed under [MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrypt0nn%2Fioserverlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrypt0nn%2Fioserverlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrypt0nn%2Fioserverlib/lists"}