{"id":15611587,"url":"https://github.com/boxdot/elm-arch-examples-rs","last_synced_at":"2025-04-28T12:21:13.297Z","repository":{"id":78593651,"uuid":"123031153","full_name":"boxdot/elm-arch-examples-rs","owner":"boxdot","description":"Elm Architecture Examples in Rust","archived":false,"fork":false,"pushed_at":"2024-06-04T15:55:44.000Z","size":60,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T09:31:31.935Z","etag":null,"topics":["elm","elm-architecture","examples","rust"],"latest_commit_sha":null,"homepage":null,"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/boxdot.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-26T21:12:14.000Z","updated_at":"2025-02-26T13:50:50.000Z","dependencies_parsed_at":"2024-10-22T17:29:53.793Z","dependency_job_id":null,"html_url":"https://github.com/boxdot/elm-arch-examples-rs","commit_stats":{"total_commits":18,"total_committers":1,"mean_commits":18.0,"dds":0.0,"last_synced_commit":"f0aecd878cb71289737cc9ff1fb3bb5a2b541a31"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Felm-arch-examples-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Felm-arch-examples-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Felm-arch-examples-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boxdot%2Felm-arch-examples-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boxdot","download_url":"https://codeload.github.com/boxdot/elm-arch-examples-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311340,"owners_count":21569011,"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":["elm","elm-architecture","examples","rust"],"created_at":"2024-10-03T06:05:36.082Z","updated_at":"2025-04-28T12:21:13.280Z","avatar_url":"https://github.com/boxdot.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elm Architecture Examples in Rust\n\nThis is a collection of examples from https://guide.elm-lang.org implementing\n\"The Elm Architecture\", sometimes also called the Elm pattern. The examples are\nimplemented as simple console applications instead of being web apps. So,\ninstead of clicking on some buttons, you usually press keyboard keys, and\ninstead of showing HTML, there is just some output to console.\n\nOne difference to the pattern is the signature of the function `subscriptions`.\nIn Elm it takes a model and depending on it, it returns subscriptions. The\nfunction is executed every time the model is updated. This makes it possible\nto remove or cancel subscriptions previously created.\n\nIn Rust, the signature is:\n\n```rust\nfn subscriptions(Model) -\u003e (Model, Sub\u003cMsg\u003e);\n```\n\nThe function is called only once on initialization. The initial model is passed\nand returned again, since on contrary to Elm we are not having a global state\nbut store everything in the model (e.g. Elm tracks open websockets in its\nruntime and so allows magically to send values, even without having a channel\nto the socket.)\n\nPractically, it should be possible to call the function after each update of\nthe model and update current subscriptions, however, this also means that we\nneed some kind of tracking and identification of subscriptions already created.\nInstead, we track a subscription with tokio's cancellation tokens (any other\nkind of a cancellation token of a stream is also possible); see the `time`\nexample.\n\n## How to run\n\n```shell\ncargo run --bin time\ncargo run --bin random\ncargo run --bin http\ncargo run --bin websocket\n```\n\n## License\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   http://www.apache.org/licenses/LICENSE-2.0)\n * MIT License ([LICENSE-MIT](LICENSE-MIT) or\n   http://opensource.org/licenses/MIT)\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this document by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboxdot%2Felm-arch-examples-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboxdot%2Felm-arch-examples-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboxdot%2Felm-arch-examples-rs/lists"}