{"id":17209341,"url":"https://github.com/de-vri-es/tokio-seqpacket-rs","last_synced_at":"2025-04-05T19:10:33.926Z","repository":{"id":39637626,"uuid":"299375752","full_name":"de-vri-es/tokio-seqpacket-rs","owner":"de-vri-es","description":"unix seqpacket sockets for tokio","archived":false,"fork":false,"pushed_at":"2024-12-05T21:18:08.000Z","size":133,"stargazers_count":15,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-29T18:06:21.476Z","etag":null,"topics":["ancillary-data","hacktoberfest","rust-library","seqpacket-sockets","tokio"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/de-vri-es.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2020-09-28T16:59:30.000Z","updated_at":"2024-12-05T21:18:12.000Z","dependencies_parsed_at":"2023-12-11T21:29:29.155Z","dependency_job_id":"0fb22e7f-bd27-4cd7-86aa-c554f4187420","html_url":"https://github.com/de-vri-es/tokio-seqpacket-rs","commit_stats":{"total_commits":124,"total_committers":8,"mean_commits":15.5,"dds":"0.12903225806451613","last_synced_commit":"a76f11ceab84917bd2aef6737ac66b47b7462825"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ftokio-seqpacket-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ftokio-seqpacket-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ftokio-seqpacket-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/de-vri-es%2Ftokio-seqpacket-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/de-vri-es","download_url":"https://codeload.github.com/de-vri-es/tokio-seqpacket-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247386262,"owners_count":20930619,"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":["ancillary-data","hacktoberfest","rust-library","seqpacket-sockets","tokio"],"created_at":"2024-10-15T02:51:22.028Z","updated_at":"2025-04-05T19:10:33.905Z","avatar_url":"https://github.com/de-vri-es.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docs.rs](https://docs.rs/tokio-seqpacket/badge.svg)](https://docs.rs/tokio-seqpacket/)\n[![Tests](https://github.com/de-vri-es/tokio-seqpacket-rs/workflows/tests/badge.svg)](https://github.com/de-vri-es/tokio-seqpacket-rs/actions?query=workflow%3Atests+branch%3Amain)\n\n# tokio-seqpacket\n\nUnix seqpacket sockets for [tokio](https://docs.rs/tokio).\n\nSeqpacket sockets combine a number of useful properties:\n* They are connection oriented.\n* They guarantee in-order message delivery.\n* They provide datagrams with well-defined semantics for passing along file descriptors.\n\nThese properties make seqpacket sockets very well suited for local servers that need to pass file-descriptors around with their clients.\n\nYou can create a [`UnixSeqpacketListener`] to start accepting connections,\nor create a [`UnixSeqpacket`] to connect to a listening socket.\nYou can also create a pair of connected sockets with [`UnixSeqpacket::pair()`].\n\n## Passing file descriptors and other ancillary data.\n\nYou can use [`send_vectored_with_ancillary`][UnixSeqpacket::send_vectored_with_ancillary] and [`recv_vectored_with_ancillary`][UnixSeqpacket::recv_vectored_with_ancillary]\nto send and receive ancillary data.\nThis can be used to pass file descriptors and unix credentials over sockets.\n\n## `\u0026self` versus `\u0026mut self`\n\nSeqpacket sockets have well-defined semantics when sending or receiving on the same socket from different threads.\nAlthough the order is not guaranteed in that scenario, each datagram will be delivered intact.\nSince tokio 0.3, it is also possible for multiple tasks to await the same file descriptor.\nAs such, all I/O functions now take `\u0026self` instead of `\u0026mut self`,\nand the `split()` API has been deprecated.\n\n## Example\n```rust\nuse tokio_seqpacket::UnixSeqpacket;\n\nlet mut socket = UnixSeqpacket::connect(\"/run/foo.sock\").await?;\nsocket.send(b\"Hello!\").await?;\n\nlet mut buffer = [0u8; 128];\nlet len = socket.recv(\u0026mut buffer).await?;\nprintln!(\"{}\", String::from_utf8_lossy(\u0026buffer[..len]));\n```\n\n[`UnixSeqpacketListener`]: https://docs.rs/tokio-seqpacket/latest/tokio_seqpacket/struct.UnixSeqpacketListener.html\n[`UnixSeqpacket`]: https://docs.rs/tokio-seqpacket/latest/tokio_seqpacket/struct.UnixSeqpacket.html\n[`UnixSeqpacket::pair()`]: https://docs.rs/tokio-seqpacket/latest/tokio_seqpacket/struct.UnixSeqpacket.html#method.pair\n[UnixSeqpacket::send_vectored_with_ancillary]: https://docs.rs/tokio-seqpacket/latest/tokio_seqpacket/struct.UnixSeqpacket.html#method.send_vectored_with_ancillary\n[UnixSeqpacket::recv_vectored_with_ancillary]: https://docs.rs/tokio-seqpacket/latest/tokio_seqpacket/struct.UnixSeqpacket.html#method.recv_vectored_with_ancillary\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fde-vri-es%2Ftokio-seqpacket-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fde-vri-es%2Ftokio-seqpacket-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fde-vri-es%2Ftokio-seqpacket-rs/lists"}