{"id":29383489,"url":"https://github.com/isisneutronmuon/recsync-rs","last_synced_at":"2025-07-10T04:10:55.069Z","repository":{"id":257578430,"uuid":"852180384","full_name":"ISISNeutronMuon/recsync-rs","owner":"ISISNeutronMuon","description":"A Rust implementation of RecSync protocol with Python bindings","archived":false,"fork":false,"pushed_at":"2025-03-27T09:18:18.000Z","size":68,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-27T10:24:12.731Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ISISNeutronMuon.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}},"created_at":"2024-09-04T11:16:04.000Z","updated_at":"2025-03-27T09:18:22.000Z","dependencies_parsed_at":"2024-09-17T14:39:42.547Z","dependency_job_id":null,"html_url":"https://github.com/ISISNeutronMuon/recsync-rs","commit_stats":null,"previous_names":["isisneutronmuon/recsync-rs"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ISISNeutronMuon/recsync-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Frecsync-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Frecsync-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Frecsync-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Frecsync-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ISISNeutronMuon","download_url":"https://codeload.github.com/ISISNeutronMuon/recsync-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ISISNeutronMuon%2Frecsync-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264526965,"owners_count":23623197,"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-10T04:10:54.445Z","updated_at":"2025-07-10T04:10:55.057Z","avatar_url":"https://github.com/ISISNeutronMuon.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recsync-rs\n\nA rust implementation of [recsync](https://github.com/ChannelFinder/recsync) protocl with python bindings.Aiming for bug to bug compatibility with current implementation of RecCeiver.  \nSee the [recsync](https://github.com/ChannelFinder/recsync) original repository for details about the protocol and theory of operation.\n\n## Project status \nThe project initially would implement only **ReCaster** in Rust with Python binding to be used along with [p4p](https://github.com/mdavidsaver/p4p). \n**RecCeiver** is not implemented yet. Recsync-rs is split into different sections. First part is `wire` which implements only the protocol definition, encoders and decoders. \nIt used by **ReCaster** and **RecCeiver** (not implemented yet). Second part is `reccaster` which is **ReCaster** implementation, as it will be used as rust library. \nFinally, `pyreccaster` is a [pyo3](https://github.com/PyO3/pyo3) Rust-wrapped Python library of `reccaster`.\n\n### RecCaster functionality\n\n* [X] Announcement Message\n* [X] Ping\n* [X] Add Record\n* [X] Add Info\n* [ ] Delete Record\n\n## Usage Example \n\nUsing Rust\n```rust\nuse reccaster::{record::Record, Reccaster};\n\n#[tokio::main]\nasync fn main() {\n\n    let mut record = Record::new(\"DEV:RECASTER:RUST\".to_string(), \"ai\".to_string());\n    record.properties.insert(\"recordDesc\".to_string(), \"Rust Recaster\".to_string());\n    let records: Vec\u003cRecord\u003e = vec![record];\n\n    let mut props:  HashMap\u003cString, String\u003e = HashMap::new();\n    props.insert(\"ENGINEER\".into(), \"Rust Recaster\".into());\n    props.insert(\"HOSTNAME\".into(), \"Example-Host-Machine\".into());\n\n    let mut caster = Reccaster::new(records, Some(props)).await;\n    caster.run().await;\n}\n```\n\nUsing Python bindings\n```python\nimport asyncio\nfrom pyreccaster import PyReccaster, PyRecord\nfrom p4p.nt import NTScalar\nfrom p4p.server.asyncio import SharedPV\nfrom p4p.server import Server\n\n\nasync def main():\n    pv = SharedPV(nt=NTScalar('d'), initial=0.0)\n\n    @pv.put\n    def handle(pv, op):\n        pv.post(op.value())\n        print(f\"{op.value()}\")\n        op.done()\n\n    records = [\n        PyRecord(name=\"DEV:P4P:VAL\", type=\"ai\", alias=\"DEV:P4P:TEST\", properties={\"recordDesc\": \"P4P Recaster\"}),\n    ]\n\n    properties = {\n        \"ENGINEER\": \"P4P ENGINEER\",\n        \"HOSTNAME\": \"P4P Example Machine\",\n    }\n\n    with Server(providers=[{\"DEV:P4P:VAL\": pv}]):\n        py_reccaster = await PyReccaster.setup(records, properties)\n        await py_reccaster.run()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## Requirements\n* Rust 1.54.0 or later\n* Python 3.7 or later\n* [Maturin](https://github.com/PyO3/maturin) \n\n## Build and Installation\n\nRust library\n```bash\ncargo build\n```\n\n### Building Python bindings\n\nEnsure that [Maturin](https://github.com/PyO3/maturin) is installed.\n\n```bash\npip install maturin\n```\n\n```bash\ncd pyreccaster\nmaturin build\n# to install the python bindings\npip install . \n```\n\n### Cross-Compile Python bindings for Windows\n\nEnsure that [Maturin](https://github.com/PyO3/maturin) is installed.\n\nAdd rust windows target\n```bash\nrustup target add x86_64-pc-windows-gnu\n```\n\nInstall `mingw-w64` for windowws cross-compilation\n```bash\napt install mingw-w64\n```\n\nBuild for specific target and python version\n```bash\nmaturin build --release --target x86_64-pc-windows-gnu --interpreter python3.9\n```\n\n### Cross-Compile Python bindings for Arm64\n\nAdd arm taget\n```bash\nrustup target add aarch64-linux-gnu-gcc\n```\n\n## License\n\nThis project is licensed under both the MIT License and the BSD 3-Clause License.  Users, contributors, and distributors must comply with the terms of both licenses. See the `LICENSE` file for more details.\n\n## Acknowledgements\nRecsync-rs is a rust reimplementation of [recsync](https://github.com/ChannelFinder/recsync) protocol.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisisneutronmuon%2Frecsync-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisisneutronmuon%2Frecsync-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisisneutronmuon%2Frecsync-rs/lists"}