{"id":25838575,"url":"https://github.com/vsrs/rsciter","last_synced_at":"2025-03-01T03:51:53.394Z","repository":{"id":179113152,"uuid":"662953937","full_name":"vsrs/rsciter","owner":"vsrs","description":"Unofficial Rust bindings for Sciter","archived":false,"fork":false,"pushed_at":"2024-09-19T15:38:22.000Z","size":208,"stargazers_count":6,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T05:52:54.490Z","etag":null,"topics":["rust-bindings","sciter","sciter-js-sdk"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vsrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-07-06T08:40:04.000Z","updated_at":"2024-09-26T15:43:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5338a716-1027-4f21-aa46-153f362dc87b","html_url":"https://github.com/vsrs/rsciter","commit_stats":null,"previous_names":["vsrs/rsciter"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsrs%2Frsciter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsrs%2Frsciter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsrs%2Frsciter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vsrs%2Frsciter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vsrs","download_url":"https://codeload.github.com/vsrs/rsciter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241313171,"owners_count":19942418,"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":["rust-bindings","sciter","sciter-js-sdk"],"created_at":"2025-03-01T03:51:52.857Z","updated_at":"2025-03-01T03:51:53.384Z","avatar_url":"https://github.com/vsrs.png","language":"Rust","readme":"## Description\n[![Work in Progress](https://img.shields.io/badge/status-work%20in%20progress-yellow)](https://github.com/vsrs/rsciter)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nThis is **unofficial** Rust bindings for [Sciter](https://sciter.com)\n\n## Disclaimer\nThis is a work in progress library and is not yet ready for production use.\n\n## Differencies from [rust-sciter](https://github.com/sciter-sdk/rust-sciter)\n- Never panics\n- Uses [bindgen](https://github.com/rust-lang/rust-bindgen) instead of hand-written code.\n- Utilizes Sciter's own functions for windows/application management.\n- The primary goal is not to provide a complete Sciter API, but to simplify the interaction between the backend (in Rust) and the frontend (Sciter.JS UI).\n\n## Exporting xfunctions (e.g. functions available via [window.xcall](https://docs.sciter.com/docs/DOM/Window#xcall))\n  ```rust\n  #[rsciter::xmod] // mark the module, that's it!\n  mod NativeModule {\n      pub fn append_log(id: u64, message: \u0026str) { ... }\n      pub fn user_name() -\u003e String { ... }\n  }\n  ```\n  JS side:\n  ```js\n  const sum = Window.this.xcall(\"sum\", 12, 12);\n  ```\n  For details, see this samples:\n  - [./crates/rsciter/examples/window_functions.rs](https://github.com/vsrs/rsciter/blob/master/crates/rsciter/examples/window_functions.rs#L15)\n  - [./crates/rsciter/examples/window_stateful_api.rs](https://github.com/vsrs/rsciter/blob/master/crates/rsciter/examples/window_stateful_api.rs#L15) \n\n## Sciter Object Model support\nYou can export entire backend module with a single `#[rsciter::asset_ns]` macro:\n```rust\n#[rsciter::asset_ns]\nmod Db {\n    // exported Db.open function\n    pub fn open(path: \u0026str, flags: u64) -\u003e Object {...}\n\n    // exported struct with fields\n    pub struct Object {\n        path: String,\n        flags: u64,\n    }\n\n    // additionally export update method\n    impl Object {\n        pub fn update(\u0026self, value: \u0026str) -\u003e UpdateRes {...}\n    }\n\n    // exported struct with `message` method\n    struct UpdateRes(String);\n    impl UpdateRes {\n        pub fn message(\u0026self) -\u003e \u0026str {\n            \u0026self.0\n        }\n    }\n}\n```\nJS side:\n```js\nconst obj = Db.open(\"test.db\", 4);\nconsole.log(`open result: \"${obj}, ${obj.path}, ${obj.flags}\"`);\n// open result: \"[asset Object], test.db, 4\"\n\nconst updateRes = obj.update(\"new data\");\nconsole.log(updateRes, updateRes.message);\n// [asset UpdateRes] function () {\n//    [native code]\n// }\n\nconsole.log(`Update result: \"${updateRes.message()}\"`);\n// Update result: \"Updating: `new data` for `test.db` with `4`\"\n```\nSOM samples:\n  - [./crates/rsciter/examples/asset_ns.rs](https://github.com/vsrs/rsciter/blob/master/crates/rsciter/examples/asset_ns.rs#L28)\n  - [./crates/rsciter/examples/global_asset.rs](https://github.com/vsrs/rsciter/blob/master/crates/rsciter/examples/global_asset.rs#L33) \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsrs%2Frsciter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvsrs%2Frsciter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvsrs%2Frsciter/lists"}