ActivityPub Viewer

A small tool to view real-world ActivityPub objects as JSON! Enter a URL or username from Mastodon or a similar service below, and we'll send a request with the right Accept header to the server to view the underlying object.

Open in browser →
{ "@context": [ "https://join-lemmy.org/context.json", "https://www.w3.org/ns/activitystreams" ], "type": "OrderedCollection", "id": "https://programming.dev/c/rust/outbox", "totalItems": 50, "orderedItems": [ { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/9473d151-2743-4b72-9e64-4df8de9e90c5", "actor": "https://discuss.tchncs.de/u/copacetic", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://discuss.tchncs.de/post/25216950", "attributedTo": "https://discuss.tchncs.de/u/copacetic", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Speeding up the Rust edit-build-run cycle", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://davidlattimore.github.io/posts/2024/02/04/speeding-up-the-rust-edit-build-run-cycle.html", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "sensitive": false, "published": "2024-11-14T20:50:12.241854Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://discuss.tchncs.de/post/25216950", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/d33a61de-3268-42cf-9373-4c2751842034" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/9cc7103c-0a14-4801-ac44-5a091ca1da28", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/21660156", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Rust Foundation Releases Problem Statement on C++/Rust Interoperability", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://foundation.rust-lang.org/news/rust-foundation-releases-problem-statement-on-c-rust-interoperability/", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/652a715a-ba04-436b-824a-a6cc80080370.png" }, "sensitive": false, "published": "2024-11-13T08:19:27.149660Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/21660156", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/1d17b7b4-d859-4b0a-a658-fa1c6e2bb647" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/476fa420-bbc2-49c7-9337-107ec59d75f3", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/21646296", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Rust needs an official specification", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://tweedegolf.nl/en/blog/140/rust-needs-an-official-specification", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/376b42aa-3a27-40c6-bdd8-e0ebfe306030.png" }, "sensitive": false, "published": "2024-11-12T21:02:36.887852Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/21646296", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/a8fdf34c-4ee0-42cc-bbbb-6d9dc7366373" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/df73c14a-b8bb-45a0-b3eb-7b335fafcfae", "actor": "https://programming.dev/u/AsudoxDev", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/21622044", "attributedTo": "https://programming.dev/u/AsudoxDev", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Embedded and sandboxed scripting languages in Rust", "cc": [], "content": "<p>I want to allow the users of my project be able to write the driving logic, while I provide the tools.\nWhat are some embedded scripting languages in Rust that can be sandboxed and are easy for absolute beginners?</p>\n<p>edit: Thanks for all of your answers, I decided to go with lua using mlua</p>\n", "mediaType": "text/html", "source": { "content": "I want to allow the users of my project be able to write the driving logic, while I provide the tools.\nWhat are some embedded scripting languages in Rust that can be sandboxed and are easy for absolute beginners?\n\nedit: Thanks for all of your answers, I decided to go with lua using mlua", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-11-12T08:21:01.307707Z", "updated": "2024-11-12T21:11:16.448813Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/21622044", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/d6015090-3c67-41a6-bcfe-da7c422ee6c9" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/70e064fa-5bf6-4b6c-8117-c3682b910698", "actor": "https://lemm.ee/u/Cpo", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemm.ee/post/47019932", "attributedTo": "https://lemm.ee/u/Cpo", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "sqlx::Transaction and Arc<Mutex<Transaction>>", "cc": [], "content": "<p>In order to share the running transaction into a DAO style data management class, I have wrapped the transaction in an Arc&lt;Mutex&gt; and pass it into the DAO.</p>\n<p>The issue is, once the transaction is in there I cannot call commit() on it because it cannot be moved out of the Arc&lt;Mutex&gt; anymore, as the commit requires a mut self.</p>\n<p>Any ideas on how to work around this?</p>\n", "mediaType": "text/html", "source": { "content": "In order to share the running transaction into a DAO style data management class, I have wrapped the transaction in an Arc<Mutex> and pass it into the DAO.\n\nThe issue is, once the transaction is in there I cannot call commit() on it because it cannot be moved out of the Arc<Mutex> anymore, as the commit requires a mut self.\n\nAny ideas on how to work around this?", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-11-10T10:26:51.441265Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemm.ee/post/47019932", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/6563b08e-f4ec-4890-a024-ef8069cbf5bb" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/a6109dcd-073a-41b7-a4c7-a8d72b53623c", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/21457535", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Google Summer of Code 2024 results", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://blog.rust-lang.org/2024/11/07/gsoc-2024-results.html", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/25d141f8-3c7c-4b73-a440-d44ab17de745.jpeg" }, "sensitive": false, "published": "2024-11-07T18:56:47.023471Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/21457535", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/2bc5a8a0-b434-49c6-91b3-45002094f8cc" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/b1108d68-8eb6-45e9-a882-4ca0a71c8e6e", "actor": "https://infosec.pub/u/Doods", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://infosec.pub/post/19555901", "attributedTo": "https://infosec.pub/u/Doods", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "gtk-rs change widget appearance at runtime.", "cc": [], "content": "<p>It might be lack of sleep, but I can’t figure this out.</p>\n<p>I have a <code>Label</code>, and I want its text to be red when it represents an error, and I want it be green when it represent “good to go”.</p>\n<p>I found search result for <code>C</code> and maybe a solution for <code>Python</code>, but nothing for <code>Rust</code>.</p>\n<p>I tried manually setting the <code>css-classes</code> property and running <code>queue_draw()</code>; it didn’t work.</p>\n<p>I can have a <code>gtk::Box</code> or a <code>Frame</code> that I place where the <code>Label</code> should go, then declare two <code>Label</code>s, and use <code>set_child()</code> to switch between them, but that seems like an ugly solution.</p>\n<p>Do you have a solution?</p>\n<p>SOLVED:</p>\n<p>I have to add a “.” before declaring a CSS “thing” for it to be considered a class.</p>\n<p>Ex:</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">.overlay {\n</span><span style=\"color:#323232;\"> background: rgba(60, 60, 60, 1);\n</span><span style=\"color:#323232;\"> font-size: 25px;\n</span><span style=\"color:#323232;\">}\n</span></pre>\n<p>instead of:</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">overlay {\n</span><span style=\"color:#323232;\"> background: rgba(60, 60, 60, 1);\n</span><span style=\"color:#323232;\"> font-size: 25px;)\n</span><span style=\"color:#323232;\">}\n</span></pre>\n<blockquote>\n<p>Just use label.add_css_class(), label.remove_css_class() or label.set_css_classes() and make sure to properly load your CSS style sheets,</p>\n</blockquote>\n<p>Source: <a href=\"https://infosec.pub/post/19555901/12616986\" rel=\"nofollow\"> the comment of d_k_bo@feddit.org</a></p>\n", "mediaType": "text/html", "source": { "content": "It might be lack of sleep, but I can't figure this out.\n\nI have a `Label`, and I want its text to be red when it represents an error, and I want it be green when it represent \"good to go\".\n\nI found search result for `C` and maybe a solution for `Python`, but nothing for `Rust`.\n\nI tried manually setting the `css-classes` property and running `queue_draw()`; it didn't work.\n\nI can have a `gtk::Box` or a `Frame` that I place where the `Label` should go, then declare two `Label`s, and use `set_child()` to switch between them, but that seems like an ugly solution.\n\nDo you have a solution?\n\nSOLVED:\n\nI have to add a \".\" before declaring a CSS \"thing\" for it to be considered a class.\n\nEx:\n```\n.overlay {\n background: rgba(60, 60, 60, 1);\n font-size: 25px;\n}\n```\ninstead of:\n```\noverlay {\n background: rgba(60, 60, 60, 1);\n font-size: 25px;)\n}\n```\n\n> Just use label.add_css_class(), label.remove_css_class() or label.set_css_classes() and make sure to properly load your CSS style sheets,\n\nSource: [ the comment of d_k_bo@feddit.org](https://infosec.pub/post/19555901/12616986)\n", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-31T18:38:05.434623Z", "updated": "2024-11-01T14:57:17.038706Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://infosec.pub/post/19555901", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/7603d028-ab99-4817-a520-bee17d319f28" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/3b91dd3c-db16-426d-84a9-9d8a0456795c", "actor": "https://lemmy.world/u/aclarke", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/21465843", "attributedTo": "https://lemmy.world/u/aclarke", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "I present: Managarr - A TUI and CLI to manage your Servarr instances", "cc": [], "content": "<p>After almost 3 years of work, I’ve finally managed to get this project stable enough to release an alpha version!</p>\n<p>I’m proud to present <a href=\"https://github.com/Dark-Alex-17/managarr\" rel=\"nofollow\">Managarr - A TUI and CLI for managing your Servarr instances</a>! At the moment, the alpha version only supports Radarr.</p>\n<p>Not all features are implemented for the alpha version, like managing quality profiles or quality definitions, etc.</p>\n<p>Here’s some screenshots of the TUI:</p>\n<p><img src=\"https://lemmy.world/pictrs/image/04e81326-3e2f-48b6-8b38-3b4534eefbd8.png\" alt=\"\" />\n<img src=\"https://lemmy.world/pictrs/image/c1c46b53-0873-4213-85e3-3d8502dda69a.png\" alt=\"\" />\n<img src=\"https://lemmy.world/pictrs/image/6ca64017-a9cd-440d-bc8b-16388cdc422e.png\" alt=\"\" />\n<img src=\"https://lemmy.world/pictrs/image/b503f081-0130-424c-9e60-c4ef74042976.png\" alt=\"\" />\n<img src=\"https://lemmy.world/pictrs/image/34b6071e-e8bd-47e5-adf2-b9e3f45a0d07.png\" alt=\"\" />\n<img src=\"https://lemmy.world/pictrs/image/282e6d32-0091-4021-b330-b4de51173a3f.png\" alt=\"\" />\n<img src=\"https://lemmy.world/pictrs/image/99cd60c8-de15-42e8-8988-0e999233c353.png\" alt=\"\" /></p>\n<p>Additionally, you can use it as a CLI for Radarr; For example, to search for a new film:</p>\n<p><code>managarr radarr search-new-movie --query “star wars”</code></p>\n<p>Or you can add a new movie by its TMDB ID:</p>\n<p><code>managarr radarr add movie --tmdb-id 1895 --root-folder-path /nfs/movies --quality-profile-id 1</code></p>\n<p>All features available in the TUI are also available via the CLI.</p>\n", "mediaType": "text/html", "source": { "content": "After almost 3 years of work, I've finally managed to get this project stable enough to release an alpha version!\n\nI'm proud to present [Managarr - A TUI and CLI for managing your Servarr instances](https://github.com/Dark-Alex-17/managarr)! At the moment, the alpha version only supports Radarr.\n\nNot all features are implemented for the alpha version, like managing quality profiles or quality definitions, etc.\n\nHere's some screenshots of the TUI:\n\n![](https://lemmy.world/pictrs/image/04e81326-3e2f-48b6-8b38-3b4534eefbd8.png)\n![](https://lemmy.world/pictrs/image/c1c46b53-0873-4213-85e3-3d8502dda69a.png)\n![](https://lemmy.world/pictrs/image/6ca64017-a9cd-440d-bc8b-16388cdc422e.png)\n![](https://lemmy.world/pictrs/image/b503f081-0130-424c-9e60-c4ef74042976.png)\n![](https://lemmy.world/pictrs/image/34b6071e-e8bd-47e5-adf2-b9e3f45a0d07.png)\n![](https://lemmy.world/pictrs/image/282e6d32-0091-4021-b330-b4de51173a3f.png)\n![](https://lemmy.world/pictrs/image/99cd60c8-de15-42e8-8988-0e999233c353.png)\n\nAdditionally, you can use it as a CLI for Radarr; For example, to search for a new film:\n\n`managarr radarr search-new-movie --query \"star wars\"`\n\nOr you can add a new movie by its TMDB ID:\n\n`managarr radarr add movie --tmdb-id 1895 --root-folder-path /nfs/movies --quality-profile-id 1`\n\nAll features available in the TUI are also available via the CLI.", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://github.com/Dark-Alex-17/managarr", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/dbe32092-33da-49fa-8d14-236fd922fd20.png" }, "sensitive": false, "published": "2024-10-31T04:21:01.517634Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/21465843", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/75abb2dc-87fe-4e2c-a36a-0fdd51a79a24" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/36f74f5c-f743-4515-adba-f511a3e5571c", "actor": "https://lemmy.world/u/Giooschi", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/21334791", "attributedTo": "https://lemmy.world/u/Giooschi", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "A comparison of Rust's borrow checker to the one in C#", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://em-tg.github.io/csborrow/", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "sensitive": false, "published": "2024-10-27T15:26:48.478083Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/21334791", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/bb6f5325-0e43-4a55-9f7e-1fde434bf765" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/0a6abe94-38ef-4071-8fa6-9ee440454e8c", "actor": "https://lemmy.world/u/trymeout", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/21156741", "attributedTo": "https://lemmy.world/u/trymeout", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Bash Script to compile a single rust script, execute the binary and delete the binary", "cc": [], "content": "<p>I would like to share a bash script I made for when you want to simply run a rust script once and delete it. Instead of having compile the script with <code>rustc</code>, running the binary and then deleting the binary, you can achive all of this with this bash script below.</p>\n<p>The first argument will be the rust script file name. The <code>.rs</code> file extension is optional. The rest of the arguments are passed into the executed binary.</p>\n<p>Simply name the bash script to something like <code>rust-run.sh</code>.</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">#!/bin/bash\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">#Get file path from first parameter\n</span><span style=\"color:#323232;\">path=$(dirname &quot;$1&quot;)\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">#Get file name from first parameter\n</span><span style=\"color:#323232;\">fileName=$(basename &quot;$1&quot;)\n</span><span style=\"color:#323232;\">fileName=&quot;${fileName%&#39;.rs&#39;}&quot;\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">#Compile executable and save it in the same directory as the rust script\n</span><span style=\"color:#323232;\">rustc &quot;${path}/${fileName}.rs&quot; -o &quot;${path}/${fileName}&quot;\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">#If rustc commands retuned any errors, unable to compile the rust script\n</span><span style=\"color:#323232;\">if [ $? -ne 0 ]; then\n</span><span style=\"color:#323232;\"> return\n</span><span style=\"color:#323232;\">fi\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">#Execute compilled executable and pass the rest of the parameters into the executable\n</span><span style=\"color:#323232;\">&quot;${path}/${fileName}&quot; ${*:2}\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">#Delete compillled executable\n</span><span style=\"color:#323232;\">rm &quot;${path}/${fileName}&quot;\n</span></pre>\n<p>If someone wants to rewrite this in rust or add these features into the <code>rustc</code>, feel free to do so.</p>\n", "mediaType": "text/html", "source": { "content": "I would like to share a bash script I made for when you want to simply run a rust script once and delete it. Instead of having compile the script with `rustc`, running the binary and then deleting the binary, you can achive all of this with this bash script below.\n\nThe first argument will be the rust script file name. The `.rs` file extension is optional. The rest of the arguments are passed into the executed binary.\n\nSimply name the bash script to something like `rust-run.sh`.\n\n```\n#!/bin/bash\n\n#Get file path from first parameter\npath=$(dirname \"$1\")\n\n#Get file name from first parameter\nfileName=$(basename \"$1\")\nfileName=\"${fileName%'.rs'}\"\n\n#Compile executable and save it in the same directory as the rust script\nrustc \"${path}/${fileName}.rs\" -o \"${path}/${fileName}\"\n\n#If rustc commands retuned any errors, unable to compile the rust script\nif [ $? -ne 0 ]; then\n return\nfi\n\n#Execute compilled executable and pass the rest of the parameters into the executable\n\"${path}/${fileName}\" ${*:2}\n\n#Delete compillled executable\nrm \"${path}/${fileName}\"\n```\n\nIf someone wants to rewrite this in rust or add these features into the `rustc`, feel free to do so.", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-22T22:55:50.629809Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/21156741", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/71206867-1fad-477d-8a6e-f8a164dba4f4" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/ff0c8ca7-71d0-477e-99e9-c164d3de345c", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20859618", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Rustls Outperforms OpenSSL and BoringSSL - Prossimo", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://www.memorysafety.org/blog/rustls-performance-outperforms/", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/d8ce60a5-0115-401f-8385-784de86f8f5f.png" }, "sensitive": false, "published": "2024-10-22T18:16:46.562825Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20859618", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/00eac5ef-82d9-42d5-9e61-4c1cc4f54a24" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/f3d63dc1-e74a-4ea0-8ca7-107e61b2ede2", "actor": "https://programming.dev/u/Matty_r", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20825137", "attributedTo": "https://programming.dev/u/Matty_r", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Help please. Vscode and breakpoints with Yew + Tauri", "cc": [], "content": "<p>Hi all,</p>\n<p>I’m going through and giving a bunch if different GUI frameworks a go and have tried iced, egui and Slint. Iced was by far the easiest to get started and just seemed fairly logical for layouts, Slint was pretty cool - VSCode actually has like a wysiwyg-editor that allows you to drag components around etc.</p>\n<p>Unfortunately I’m having issues getting breakpoints to work when using VSCode, Tauri, plus a Rust frontend (yew, dioxus, etc). I think its because what is compiled isn’t where my actual code exists? If I use a JavaScript frontend it hits breakpoints fine, but that’s not what I’m wanting to use at the moment.</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">{\n</span><span style=\"color:#323232;\"> // Use IntelliSense to learn about possible attributes.\n</span><span style=\"color:#323232;\"> // Hover to view descriptions of existing attributes.\n</span><span style=\"color:#323232;\"> // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n</span><span style=\"color:#323232;\"> &quot;version&quot;: &quot;0.2.0&quot;,\n</span><span style=\"color:#323232;\"> &quot;configurations&quot;: [\n</span><span style=\"color:#323232;\"> {\n</span><span style=\"color:#323232;\"> &quot;type&quot;: &quot;lldb&quot;,\n</span><span style=\"color:#323232;\"> &quot;request&quot;: &quot;launch&quot;,\n</span><span style=\"color:#323232;\"> &quot;name&quot;: &quot;Tauri Development Debug&quot;,\n</span><span style=\"color:#323232;\"> &quot;cargo&quot;: {\n</span><span style=\"color:#323232;\"> &quot;args&quot;: [\n</span><span style=\"color:#323232;\"> &quot;build&quot;,\n</span><span style=\"color:#323232;\"> &quot;--manifest-path=./src-tauri/Cargo.toml&quot;,\n</span><span style=\"color:#323232;\"> &quot;--no-default-features&quot;\n</span><span style=\"color:#323232;\"> ]\n</span><span style=\"color:#323232;\"> },\n</span><span style=\"color:#323232;\"> &quot;env&quot;: {\n</span><span style=\"color:#323232;\"> &quot;WEBKIT_DISABLE_COMPOSITING_MODE&quot;: &quot;1&quot;\n</span><span style=\"color:#323232;\"> },\n</span><span style=\"color:#323232;\"> // task for the `beforeDevCommand` if used, must be configured in `.vscode/tasks.json`\n</span><span style=\"color:#323232;\"> &quot;preLaunchTask&quot;: &quot;ui:dev&quot;\n</span><span style=\"color:#323232;\"> },\n</span><span style=\"color:#323232;\"> {\n</span><span style=\"color:#323232;\"> &quot;type&quot;: &quot;lldb&quot;,\n</span><span style=\"color:#323232;\"> &quot;request&quot;: &quot;launch&quot;,\n</span><span style=\"color:#323232;\"> &quot;name&quot;: &quot;Tauri Production Debug&quot;,\n</span><span style=\"color:#323232;\"> &quot;cargo&quot;: {\n</span><span style=\"color:#323232;\"> &quot;args&quot;: [&quot;build&quot;, &quot;--release&quot;, &quot;--manifest-path=./src-tauri/Cargo.toml&quot;]\n</span><span style=\"color:#323232;\"> },\n</span><span style=\"color:#323232;\"> // task for the `beforeBuildCommand` if used, must be configured in `.vscode/tasks.json`\n</span><span style=\"color:#323232;\"> &quot;preLaunchTask&quot;: &quot;ui:build&quot;\n</span><span style=\"color:#323232;\"> }\n</span><span style=\"color:#323232;\"> ]\n</span><span style=\"color:#323232;\"> }\n</span></pre>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">{\n</span><span style=\"color:#323232;\"> &quot;version&quot;: &quot;2.0.0&quot;,\n</span><span style=\"color:#323232;\"> &quot;tasks&quot;: [\n</span><span style=\"color:#323232;\"> {\n</span><span style=\"color:#323232;\"> &quot;label&quot;: &quot;ui:dev&quot;,\n</span><span style=\"color:#323232;\"> &quot;type&quot;: &quot;shell&quot;,\n</span><span style=\"color:#323232;\"> &quot;isBackground&quot;: true,\n</span><span style=\"color:#323232;\"> // change this to your `beforeDevCommand`:\n</span><span style=\"color:#323232;\"> &quot;command&quot;: &quot;trunk&quot;,\n</span><span style=\"color:#323232;\"> &quot;args&quot;: [&quot;serve&quot;]\n</span><span style=\"color:#323232;\"> }\n</span><span style=\"color:#323232;\"> ]\n</span><span style=\"color:#323232;\"> }\n</span></pre>\n", "mediaType": "text/html", "source": { "content": "Hi all,\n\nI'm going through and giving a bunch if different GUI frameworks a go and have tried iced, egui and Slint. Iced was by far the easiest to get started and just seemed fairly logical for layouts, Slint was pretty cool - VSCode actually has like a wysiwyg-editor that allows you to drag components around etc.\n\nUnfortunately I'm having issues getting breakpoints to work when using VSCode, Tauri, plus a Rust frontend (yew, dioxus, etc). I think its because what is compiled isn't where my actual code exists? If I use a JavaScript frontend it hits breakpoints fine, but that's not what I'm wanting to use at the moment. \n\n``` launch.json\n{\n // Use IntelliSense to learn about possible attributes.\n // Hover to view descriptions of existing attributes.\n // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n \"version\": \"0.2.0\",\n \"configurations\": [\n {\n \"type\": \"lldb\",\n \"request\": \"launch\",\n \"name\": \"Tauri Development Debug\",\n \"cargo\": {\n \"args\": [\n \"build\",\n \"--manifest-path=./src-tauri/Cargo.toml\",\n \"--no-default-features\"\n ]\n },\n \"env\": {\n \"WEBKIT_DISABLE_COMPOSITING_MODE\": \"1\"\n },\n // task for the `beforeDevCommand` if used, must be configured in `.vscode/tasks.json`\n \"preLaunchTask\": \"ui:dev\"\n },\n {\n \"type\": \"lldb\",\n \"request\": \"launch\",\n \"name\": \"Tauri Production Debug\",\n \"cargo\": {\n \"args\": [\"build\", \"--release\", \"--manifest-path=./src-tauri/Cargo.toml\"]\n },\n // task for the `beforeBuildCommand` if used, must be configured in `.vscode/tasks.json`\n \"preLaunchTask\": \"ui:build\"\n }\n ]\n }\n```\n\n``` tasks.json\n{\n \"version\": \"2.0.0\",\n \"tasks\": [\n {\n \"label\": \"ui:dev\",\n \"type\": \"shell\",\n \"isBackground\": true,\n // change this to your `beforeDevCommand`:\n \"command\": \"trunk\",\n \"args\": [\"serve\"]\n }\n ]\n }\n```", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-21T19:08:57.156182Z", "updated": "2024-10-21T19:11:41.274141Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20825137", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/d7d83443-8e34-426f-b3e0-89a098ce1bf2" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/2a4ac102-42fb-4796-afa8-2c093a8f1006", "actor": "https://programming.dev/u/secana", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20779827", "attributedTo": "https://programming.dev/u/secana", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "What are you working on this week? (Okt. 20, 2024)", "cc": [], "content": "<p>Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?</p>\n", "mediaType": "text/html", "source": { "content": "Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-20T14:19:21.907411Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20779827", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/5b3298bc-f06a-42a4-add0-9853d6327204" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/543d542d-7dc5-4594-bf28-9d4646e82c2f", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20757953", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Blocking code is a leaky abstraction – notgull", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://notgull.net/blocking-leaky/", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "sensitive": false, "published": "2024-10-19T21:49:21.601274Z", "updated": "2024-10-19T21:49:46.212961Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20757953", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/16fc7466-734d-444e-9196-952bebba6b81" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/f4ece1a7-e7d8-45fa-a514-b66c6ffd022c", "actor": "https://programming.dev/u/KillTheMule", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20745166", "attributedTo": "https://programming.dev/u/KillTheMule", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Typst 0.12 released", "cc": [], "content": "<blockquote>\n<p>Typst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use</p>\n</blockquote>\n<p>Typst is awesome, in particular if you want to generate documents programmatically.</p>\n", "mediaType": "text/html", "source": { "content": ">Typst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use\n\nTypst is awesome, in particular if you want to generate documents programmatically.", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://typst.app/blog/2024/typst-0.12/", "mediaType": "text/html", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/3b44b088-9fbe-4b75-858d-4c2404b23ac1.png" }, "sensitive": false, "published": "2024-10-19T14:21:52.898567Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20745166", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/ec1e4c44-5f43-4a57-b0a8-478efc509ceb" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/2975b849-2e9f-476e-8889-7d1a9a4b648e", "actor": "https://lemmy.ml/u/4ffy", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.ml/post/21503292", "attributedTo": "https://lemmy.ml/u/4ffy", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Announcing Rust 1.82.0 | Rust Blog", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://blog.rust-lang.org/2024/10/17/Rust-1.82.0.html", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/4e66de5d-b404-471d-b9ee-7c0f4a86bc0c.jpeg" }, "sensitive": false, "published": "2024-10-17T17:09:46.851126Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.ml/post/21503292", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/b040da65-f13c-443c-a21b-d45ebe49a97d" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/4b87b0cf-37dd-47b0-927b-7821f17a1aed", "actor": "https://lemmy.bestiver.se/u/patrick", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.bestiver.se/post/61957", "attributedTo": "https://lemmy.bestiver.se/u/patrick", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Does crates.io have a backup plan?", "cc": [], "content": "<p>It’s possible that the .io cctld is going to go away [0]. Does crates.io have a backup plan at all? Does anyone know what problems it would end up causing?</p>\n<p>I imagine the package registry having to move domains is going to cause a ton of problems.</p>\n<p>Frankly, it’s concerning to me that so much of the Rust ecosystem has chosen to standardize on shaky ccTLDs. The Indian Ocean Territory (.io) is a small island territory whose only inhabitants are a single military base, it is crazy to use that domain for something important. Serbia (.rs) is more stable, but they could still cut off access for non-Serbians if they wanted to.</p>\n<p>[0] - <a href=\"https://en.wikipedia.org/wiki/.io#Phasing_Out\">en.wikipedia.org/wiki/.io#Phasing_Out</a></p>\n", "mediaType": "text/html", "source": { "content": "It's possible that the .io cctld is going to go away [0]. Does crates.io have a backup plan at all? Does anyone know what problems it would end up causing?\n\nI imagine the package registry having to move domains is going to cause a ton of problems.\n\nFrankly, it's concerning to me that so much of the Rust ecosystem has chosen to standardize on shaky ccTLDs. The Indian Ocean Territory (.io) is a small island territory whose only inhabitants are a single military base, it is crazy to use that domain for something important. Serbia (.rs) is more stable, but they could still cut off access for non-Serbians if they wanted to.\n\n[0] - https://en.wikipedia.org/wiki/.io#Phasing_Out", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-17T15:57:13.663698Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.bestiver.se/post/61957", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/bf2203be-a91a-488f-baa8-1beb85e1b78a" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/586563b7-a553-4977-a71c-27967cb1baca", "actor": "https://programming.dev/u/little_ferris", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20617271", "attributedTo": "https://programming.dev/u/little_ferris", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "What are some mind blowing Rust tricks?", "cc": [], "content": "<p>If we were to create a Rust version of <a href=\"https://wiki.haskell.org/Blow_your_mind\" rel=\"nofollow\">this page for Haskell</a>, what cool programming techniques would you add to it?</p>\n", "mediaType": "text/html", "source": { "content": "If we were to create a Rust version of [this page for Haskell](https://wiki.haskell.org/Blow_your_mind), what cool programming techniques would you add to it?", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-16T05:52:03.662509Z", "updated": "2024-10-16T08:11:53.839699Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20617271", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/29a950cd-020e-4f0d-bace-59de77e4aaa7" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/15287b66-3a31-43f0-9d0c-5d95cca1c8ff", "actor": "https://lemmy.world/u/erlend_sh", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20784801", "attributedTo": "https://lemmy.world/u/erlend_sh", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "rsky: AT Protocol implementation in Rust – a Blacksky project", "cc": [], "content": "<p>Links:</p>\n<ul>\n<li><a href=\"https://atproto.com/\" rel=\"nofollow\">https://atproto.com</a>\n- <a href=\"https://atproto.com/articles/atproto-for-distsys-engineers\" rel=\"nofollow\">https://atproto.com/articles/atproto-for-distsys-engineers</a></li>\n<li><a href=\"https://www.blackskyweb.xyz/\" rel=\"nofollow\">https://www.blackskyweb.xyz</a>\n- <a href=\"https://bsky.app/profile/rudyfraser.com/post/3l6d7mmzhik2r\" rel=\"nofollow\">https://bsky.app/profile/rudyfraser.com/post/3l6d7mmzhik2r</a></li>\n</ul>\n<blockquote>\n<p>For a lot of us, atproto projects are some of the biggest (most users, most publicized, most code written, etc.) projects we’ve ever done. For me, it’s also my first time working in open source (ironically, someone asked me to be more open about that)</p>\n<p>If you can help, pls check out open issues.</p>\n</blockquote>\n<p>I know not everyone thinks highly of atproto around these parts, but please don’t let that get in the way of welcoming a fellow rustacean into the open source world 🦀</p>\n", "mediaType": "text/html", "source": { "content": "Links:\n\n- [https://atproto.com](https://atproto.com/)\n- [https://atproto.com/articles/atproto-for-distsys-engineers](https://atproto.com/articles/atproto-for-distsys-engineers)\n- [https://www.blackskyweb.xyz](https://www.blackskyweb.xyz/)\n- [https://bsky.app/profile/rudyfraser.com/post/3l6d7mmzhik2r](https://bsky.app/profile/rudyfraser.com/post/3l6d7mmzhik2r)\n\n> For a lot of us, atproto projects are some of the biggest (most users, most publicized, most code written, etc.) projects we’ve ever done. For me, it’s also my first time working in open source (ironically, someone asked me to be more open about that)\n> \n> If you can help, pls check out open issues.\n\nI know not everyone thinks highly of atproto around these parts, but please don’t let that get in the way of welcoming a fellow rustacean into the open source world 🦀", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://github.com/blacksky-algorithms/rsky", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/7a399f92-f226-41e6-afcd-ae0338de425b.png" }, "sensitive": false, "published": "2024-10-12T19:55:48.800034Z", "updated": "2024-10-12T20:01:00.306666Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20784801", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/9eb0d5ab-b363-4214-9ef9-54d0da929318" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/54329cdf-a7cc-43ad-bbb7-18f982539f3c", "actor": "https://programming.dev/u/Deebster", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20425405", "attributedTo": "https://programming.dev/u/Deebster", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Bacon v3 released", "cc": [], "content": "<p>Bacon is a Rust code checker designed for minimal interaction, allowing users to run it alongside their editor to receive real-time notifications about warnings, errors, or test failures (I like having it show clippy’s hints).</p>\n<p>It prioritizes displaying errors before warnings, making it easier to identify critical issues without excessive scrolling.</p>\n<p>Screenshot (from an old version I think):</p>\n<p><img src=\"https://dystroy.org/bacon/img/test.png\" alt=\"\" /></p>\n<p>v3 adds support for <a href=\"https://nexte.st/\" rel=\"nofollow\">cargo-nextest</a>, plus some QoL improvements.</p>\n<p><a href=\"https://github.com/Canop/bacon/releases/tag/v3.0.0\" rel=\"nofollow\">v3.0.0 release notes</a></p>\n", "mediaType": "text/html", "source": { "content": "Bacon is a Rust code checker designed for minimal interaction, allowing users to run it alongside their editor to receive real-time notifications about warnings, errors, or test failures (I like having it show clippy's hints).\n\nIt prioritizes displaying errors before warnings, making it easier to identify critical issues without excessive scrolling.\n\nScreenshot (from an old version I think):\n\n![](https://dystroy.org/bacon/img/test.png)\n\nv3 adds support for [cargo-nextest](https://nexte.st/), plus some QoL improvements.\n\n[v3.0.0 release notes](https://github.com/Canop/bacon/releases/tag/v3.0.0)", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://dystroy.org/bacon/", "mediaType": "text/html", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/3d8ed206-95b1-4424-8d12-0758d4ea2f12.png" }, "sensitive": false, "published": "2024-10-11T01:18:36.742016Z", "updated": "2024-10-11T01:29:26.440615Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20425405", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/9a26067e-9cc0-4035-9c8c-b8734a998b88" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/ac4716f4-06b2-4a64-b836-cd8b4a8825b1", "actor": "https://sh.itjust.works/u/cybergazer", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://sh.itjust.works/post/26446317", "attributedTo": "https://sh.itjust.works/u/cybergazer", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "My frustrations with Rust. Why is this the most loved language?", "cc": [], "content": "<p>I’m making this post after endless frustrations with learning Rust and am about to just go back to TypeScript. Looking at Rust from the outside, you’d think it was the greatest thing ever created. Everyone loves this language to a point of being a literal cult and its popularity is skyrocketing. It’s the most loved language on Stackoverflow for years on end. Yet I can’t stand working in it, it gets in my way all the time for pointless reasons mostly due to bad ergonomics of the language. Below are most of the issues I’ve encountered:</p>\n<ul>\n<li>\n<p>Cargo is doing too many things at once. It’s a build system but also a package manager but also manages dependencies? Idk what to even call it.</p>\n</li>\n<li>\n<p>Syntax is very confusing for no reason. You can’t just look at rust code and immediately know what it does. Having to pollute your code &amp;, ? and .clone() everywhere to deal with ownership, using :: to refer to static methods instead of a “static” keyword. Rust syntax is badly designed compared to most other languages I used. In a massive codebase with tons of functions and moving parts this is unreadable. Let’s take a look at hashmaps vs json</p>\n</li>\n</ul>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"font-weight:bold;color:#a71d5d;\">let mut</span><span style=\"color:#323232;\"> scores </span><span style=\"font-weight:bold;color:#a71d5d;\">= </span><span style=\"color:#323232;\">HashMap::new();\n</span><span style=\"color:#323232;\">scores.</span><span style=\"color:#62a35c;\">insert</span><span style=\"color:#323232;\">(</span><span style=\"color:#0086b3;\">String</span><span style=\"color:#323232;\">::from(</span><span style=\"color:#183691;\">&quot;Name&quot;</span><span style=\"color:#323232;\">), Joe);\n</span><span style=\"color:#323232;\">scores.</span><span style=\"color:#62a35c;\">insert</span><span style=\"color:#323232;\">(</span><span style=\"color:#0086b3;\">String</span><span style=\"color:#323232;\">::from(</span><span style=\"color:#183691;\">&quot;Age&quot;</span><span style=\"color:#323232;\">), </span><span style=\"color:#0086b3;\">23</span><span style=\"color:#323232;\">);\n</span></pre>\n<p>Supposively bad typescript</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"font-weight:bold;color:#a71d5d;\">const </span><span style=\"color:#323232;\">person </span><span style=\"font-weight:bold;color:#a71d5d;\">= </span><span style=\"color:#323232;\">{\n</span><span style=\"color:#323232;\"> name: </span><span style=\"color:#183691;\">&quot;joe&quot;</span><span style=\"color:#323232;\">,\n</span><span style=\"color:#323232;\"> age: </span><span style=\"color:#0086b3;\">23\n</span><span style=\"color:#323232;\">}\n</span></pre>\n<p>Js is way more readable. You can just look at it and immediately know what the code is doing even if you’ve never coded before. That’s good design, so why do people love rust and dislike typescript then?</p>\n<ul>\n<li>\n<p>Similarly, Async code starts to look really ugly and overengineered in rust.</p>\n</li>\n<li>\n<p>Multiple string types like &amp;str, String, str, instead of just one “str” function</p>\n</li>\n<li>\n<p>i32 i64 i8 f8 f16 f32 instead of a single unified “number” type like in typescript. Even in C you can just write “int” and be done with it so it’s not really a “low level” issue.</p>\n</li>\n<li>\n<p>Having to use #[tokio:main] to make the main function async (which should just be inbuilt functionality, btw tokio adds insane bloat to your program) yet you literally can’t write code without it. Also what’s the point of making the main function async other than 3rd party libraries requiring it?</p>\n</li>\n<li>\n<p>Speaking of bloat, a basic get request in a low level language shouldn’t be 32mb, it’s around 16kb with C and libcurl, despite the C program being more lines of code. Why is it so bloated? This makes using rust for serious embedded systems unfeasible and C a much better option.</p>\n</li>\n<li>\n<p>With cargo you literally have to compile everything instead of them shipping proper binaries. Why??? This is just a way to fry your cpu and makes larger libraries impossible to write. It should be on the part of the maintainer to build the package beforehand and add the binary. Note that i don’t mean dependencies, I mean scripts with cargo install. There is no reason a script shouldn’t be compiled beforehand.</p>\n</li>\n</ul>\n<p>Another major issue I’ve encountered is libraries in Rust, or lack thereof. Every single library in rust is half-baked. Axum doesn’t even have a home page and its docs are literally a readme file in cargo, how’s that gonna compare to express or dotnet with serious industry backing? If you write an entire codebase in Axum and then the 1 dev maintaining it decides to quit due to no funding then what do you do? No GUI framework is as stable as something like Qt or GTK, literally every rust project has like 1 dev maintaining it in his free time and has “expect breaking changes” in the readme. Nothing is stable or enterprise ready with a serious team with money backing it.</p>\n<p>As for “memory safety”, it’s a buzzword. Just use a garbage collector. They’re invulnerable to memory issues unless you write infinite while loop and suitable for 99% of applications.</p>\n<p>“But muh performance, garbage collectors are slow!”</p>\n<p>Then use C or C++ if you really need performance. Both of them are way better designed than Rust. In most cases though it’s just bikeshedding. We’re not in 1997 where we have 10mb of ram to work with, 9/10 times you don’t need to put yourself through hell to save a few megabyes of a bundle size of a web app. There are apps with billions of users that run fine on php. Also, any program you write should be extensively tested before release, so you’d catch those memory errors if you aren’t being lazy and shipping broken software to the public. So literally, what is the point of Rust?</p>\n<p>From the outside looking in, Rust is the most overwhelming proof possible to me that programmers are inheritly hobbists who like tinkering rather than actually making real world apps that solve problems. Because it’s a hard language, it’s complicated and it’s got one frivelous thing it can market “memory safety!”, and if you master it you’re better than everyone else because you learned something hard, and that’s enough for the entire programming space to rank it year after year the greatest language while rewriting minimal c programs in rust quadrupling the memory usage of them. And the thing is, that’s fine, the issue I have is people lying and saying Rust is a drop in replacement for js and is the single greatest language ever created, like come on it’s not. Its syntax and poor 3rd party library support prove that better than I ever can</p>\n<p>“Oh but in rust you learn more about computers/low level concepts, you’re just not good at coding”</p>\n<p>Who cares? Coding is a tool to get shit done and I think devs forget this way too often, like if one works easier than the other why does learning lower level stuff matter? It’s useless knowledge unless you specifically go into a field where you need lower level coding. Typescript is easy, rust is not. Typescript is therefore better at making things quick, the resourse usage doesn’t matter to 99% of people and the apps look good and function good.</p>\n<p>So at this point I’m seeing very little reason to continue. I shouldn’t have to fight a programming language, mostly for issues that are caused by lack of financial backing in 3rd party libraries or badly designed syntax and I’m about to just give up and move on, but I’m in the minority here. Apparently everyone loves dealing with hours and hours of debugging basic problems because it makes you a better programmer, or there’s some information I’m just missing. Imo tho think rust devs need to understand there’s serious value in actually making things with code, the ergonomics/good clean design of the language, and having serious 3rd party support/widespread usage of libraries. When you’re running a company you don’t have time to mess around with syntax quirks, you need thinks done, stable and out the door and I just don’t see that happening with Rust.</p>\n<p>If anyone makes a serious comment/counterargument to any of my claims here I will respond to it.</p>\n", "mediaType": "text/html", "source": { "content": "I'm making this post after endless frustrations with learning Rust and am about to just go back to TypeScript. Looking at Rust from the outside, you'd think it was the greatest thing ever created. Everyone loves this language to a point of being a literal cult and its popularity is skyrocketing. It's the most loved language on Stackoverflow for years on end. Yet I can't stand working in it, it gets in my way all the time for pointless reasons mostly due to bad ergonomics of the language. Below are most of the issues I've encountered:\n\n- Cargo is doing too many things at once. It's a build system but also a package manager but also manages dependencies? Idk what to even call it.\n\n- Syntax is very confusing for no reason. You can't just look at rust code and immediately know what it does. Having to pollute your code &, ? and .clone() everywhere to deal with ownership, using :: to refer to static methods instead of a \"static\" keyword. Rust syntax is badly designed compared to most other languages I used. In a massive codebase with tons of functions and moving parts this is unreadable. Let's take a look at hashmaps vs json \n\n```rust\nlet mut scores = HashMap::new();\nscores.insert(String::from(\"Name\"), Joe);\nscores.insert(String::from(\"Age\"), 23);\n```\n\nSupposively bad typescript\n```javascript\nconst person = {\n name: \"joe\",\n age: 23\n}\n```\n\nJs is way more readable. You can just look at it and immediately know what the code is doing even if you've never coded before. That's good design, so why do people love rust and dislike typescript then?\n\n- Similarly, Async code starts to look really ugly and overengineered in rust. \n\n- Multiple string types like &str, String, str, instead of just one \"str\" function\n\n- i32 i64 i8 f8 f16 f32 instead of a single unified \"number\" type like in typescript. Even in C you can just write \"int\" and be done with it so it's not really a \"low level\" issue.\n\n- Having to use #[tokio:main] to make the main function async (which should just be inbuilt functionality, btw tokio adds insane bloat to your program) yet you literally can't write code without it. Also what's the point of making the main function async other than 3rd party libraries requiring it?\n\n- Speaking of bloat, a basic get request in a low level language shouldn't be 32mb, it's around 16kb with C and libcurl, despite the C program being more lines of code. Why is it so bloated? This makes using rust for serious embedded systems unfeasible and C a much better option.\n\n- With cargo you literally have to compile everything instead of them shipping proper binaries. Why??? This is just a way to fry your cpu and makes larger libraries impossible to write. It should be on the part of the maintainer to build the package beforehand and add the binary. Note that i don't mean dependencies, I mean scripts with cargo install. There is no reason a script shouldn't be compiled beforehand.\n\nAnother major issue I've encountered is libraries in Rust, or lack thereof. Every single library in rust is half-baked. Axum doesn't even have a home page and its docs are literally a readme file in cargo, how's that gonna compare to express or dotnet with serious industry backing? If you write an entire codebase in Axum and then the 1 dev maintaining it decides to quit due to no funding then what do you do? No GUI framework is as stable as something like Qt or GTK, literally every rust project has like 1 dev maintaining it in his free time and has \"expect breaking changes\" in the readme. Nothing is stable or enterprise ready with a serious team with money backing it. \n\nAs for \"memory safety\", it's a buzzword. Just use a garbage collector. They're invulnerable to memory issues unless you write infinite while loop and suitable for 99% of applications.\n\n\"But muh performance, garbage collectors are slow!\"\n\nThen use C or C++ if you really need performance. Both of them are way better designed than Rust. In most cases though it's just bikeshedding. We're not in 1997 where we have 10mb of ram to work with, 9/10 times you don't need to put yourself through hell to save a few megabyes of a bundle size of a web app. There are apps with billions of users that run fine on php. Also, any program you write should be extensively tested before release, so you'd catch those memory errors if you aren't being lazy and shipping broken software to the public. So literally, what is the point of Rust?\n\nFrom the outside looking in, Rust is the most overwhelming proof possible to me that programmers are inheritly hobbists who like tinkering rather than actually making real world apps that solve problems. Because it's a hard language, it's complicated and it's got one frivelous thing it can market \"memory safety!\", and if you master it you're better than everyone else because you learned something hard, and that's enough for the entire programming space to rank it year after year the greatest language while rewriting minimal c programs in rust quadrupling the memory usage of them. And the thing is, that's fine, the issue I have is people lying and saying Rust is a drop in replacement for js and is the single greatest language ever created, like come on it's not. Its syntax and poor 3rd party library support prove that better than I ever can\n\n\"Oh but in rust you learn more about computers/low level concepts, you're just not good at coding\"\n\nWho cares? Coding is a tool to get shit done and I think devs forget this way too often, like if one works easier than the other why does learning lower level stuff matter? It's useless knowledge unless you specifically go into a field where you need lower level coding. Typescript is easy, rust is not. Typescript is therefore better at making things quick, the resourse usage doesn't matter to 99% of people and the apps look good and function good. \n\nSo at this point I'm seeing very little reason to continue. I shouldn't have to fight a programming language, mostly for issues that are caused by lack of financial backing in 3rd party libraries or badly designed syntax and I'm about to just give up and move on, but I'm in the minority here. Apparently everyone loves dealing with hours and hours of debugging basic problems because it makes you a better programmer, or there's some information I'm just missing. Imo tho think rust devs need to understand there's serious value in actually making things with code, the ergonomics/good clean design of the language, and having serious 3rd party support/widespread usage of libraries. When you're running a company you don't have time to mess around with syntax quirks, you need thinks done, stable and out the door and I just don't see that happening with Rust.\n\nIf anyone makes a serious comment/counterargument to any of my claims here I will respond to it.", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-10T22:01:32.772367Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://sh.itjust.works/post/26446317", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/541d10a6-3a66-46ed-b036-4303b9390312" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/08a1bb1e-30e1-4e24-a7ad-eab5710faff1", "actor": "https://lemmy.world/u/NorthWestWind", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20595864", "attributedTo": "https://lemmy.world/u/NorthWestWind", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "I made a TUI soundboard in Rust! (cls)", "cc": [], "content": "<p>This is my first ever Rust program.</p>\n<p>The motivation of this is to create a soundboard with global hotkey support on Wayland, because Soundux wouldn’t add it :&lt;<br />\nThat’s why this soundboard is structurally very similar to Soundux.</p>\n<p>Here’s a screenshot:<br />\n<img src=\"https://lemmy.world/pictrs/image/75f1df15-f9f1-4a2a-9d01-ebd5f68e8a02.png\" alt=\"\" /></p>\n", "mediaType": "text/html", "source": { "content": "This is my first ever Rust program.\n\nThe motivation of this is to create a soundboard with global hotkey support on Wayland, because Soundux wouldn't add it :< \nThat's why this soundboard is structurally very similar to Soundux.\n\nHere's a screenshot: \n![](https://lemmy.world/pictrs/image/75f1df15-f9f1-4a2a-9d01-ebd5f68e8a02.png)", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://github.com/North-West-Wind/cls", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/5923c54d-e2ec-42a6-bb25-e26ed3f5aa62.png" }, "sensitive": false, "published": "2024-10-07T12:23:49.152683Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20595864", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/ad94e946-dc91-4899-9ee9-563b06fbe1cc" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/4b1b7fdf-f7b3-406f-ae24-ce3af614fca7", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20286543", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Rust is rolling off the Volvo assembly line - Blog - Tweede golf", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://tweedegolf.nl/en/blog/137/rust-is-rolling-off-the-volvo-assembly-line", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/b24cb661-fc6c-4e3e-95ca-47f5f84e4d26.jpeg" }, "sensitive": false, "published": "2024-10-07T11:35:09.132531Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20286543", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/2bbc62e4-05d1-4b30-9d45-fca92a73ec7c" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/b456e527-cfb9-4fb5-bbba-56c521578860", "actor": "https://lemmy.world/u/trymeout", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20581829", "attributedTo": "https://lemmy.world/u/trymeout", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Getting debugger setup in VSCode", "cc": [], "content": "<p>Just started learning Rust today and got Rust installed, got the hello world example compiled and running. I installed <code>rust-analyzer</code> and <code>CodeLLDB</code> extensions in VSCode. Enable the <code>debug.allowBreakpointsEverywhere</code> settings to VSCode to be true. Setup a debug configuration in VSCode.</p>\n<p>However I keep getting errors from <code>rust-analyzer</code> when I run the debugger…</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">2024-10-06T22:16:04.808655Z ERROR FetchWorkspaceError: rust-analyzer failed to load workspace: Failed to load the project at /home/john/Documents/Snippets/Rust/Cargo.toml: Failed to read Cargo metadata from Cargo.toml file /home/john/Documents/Snippets/Rust/Cargo.toml, Some(Version { major: 1, minor: 81, patch: 0 }): Failed to run `cd &quot;/home/john/Documents/Snippets/Rust&quot; &amp;&amp; RUSTUP_TOOLCHAIN=&quot;/home/john/.rustup/toolchains/stable-x86_64-unknown-linux-gnu&quot; &quot;/home/john/.cargo/bin/cargo&quot; &quot;metadata&quot; &quot;--format-version&quot; &quot;1&quot; &quot;--manifest-path&quot; &quot;/home/john/Documents/Snippets/Rust/Cargo.toml&quot; &quot;--filter-platform&quot; &quot;x86_64-unknown-linux-gnu&quot;`: `cargo metadata` exited with an error: error: failed to parse manifest at `/home/john/Documents/Snippets/Rust/Cargo.toml`\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">Caused by:\n</span><span style=\"color:#323232;\"> no targets specified in the manifest\n</span><span style=\"color:#323232;\"> either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present\n</span></pre>\n<p>I not sure how to fix this.</p>\n<p>I would like to get the VSCode debugger to work for launch debugging, attach debugging and launch and attach debugging for rust running inside a docker container. This will be a good setup for getting started I believe.</p>\n<p>This is my VSCode debugger configuration…</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">{\n</span><span style=\"color:#323232;\">\t// Use IntelliSense to learn about possible attributes.\n</span><span style=\"color:#323232;\">\t// Hover to view descriptions of existing attributes.\n</span><span style=\"color:#323232;\">\t// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n</span><span style=\"color:#323232;\">\t&quot;version&quot;: &quot;0.2.0&quot;,\n</span><span style=\"color:#323232;\">\t&quot;configurations&quot;: [\n</span><span style=\"color:#323232;\">\t\t{\n</span><span style=\"color:#323232;\">\t\t\t&quot;type&quot;: &quot;lldb&quot;,\n</span><span style=\"color:#323232;\">\t\t\t&quot;request&quot;: &quot;launch&quot;,\n</span><span style=\"color:#323232;\">\t\t\t&quot;name&quot;: &quot;Debug&quot;,\n</span><span style=\"color:#323232;\">\t\t\t&quot;program&quot;: &quot;${workspaceFolder}/hello-world&quot;,\n</span><span style=\"color:#323232;\">\t\t\t&quot;args&quot;: [],\n</span><span style=\"color:#323232;\">\t\t\t&quot;cwd&quot;: &quot;${workspaceFolder}&quot;\n</span><span style=\"color:#323232;\">\t\t}\n</span><span style=\"color:#323232;\">\t]\n</span><span style=\"color:#323232;\">}\n</span><span style=\"color:#323232;\">\n</span></pre>\n<p>Any help and advice will be most appreciated.</p>\n", "mediaType": "text/html", "source": { "content": "Just started learning Rust today and got Rust installed, got the hello world example compiled and running. I installed `rust-analyzer` and `CodeLLDB` extensions in VSCode. Enable the `debug.allowBreakpointsEverywhere` settings to VSCode to be true. Setup a debug configuration in VSCode.\n\nHowever I keep getting errors from `rust-analyzer` when I run the debugger...\n\n```\n2024-10-06T22:16:04.808655Z ERROR FetchWorkspaceError: rust-analyzer failed to load workspace: Failed to load the project at /home/john/Documents/Snippets/Rust/Cargo.toml: Failed to read Cargo metadata from Cargo.toml file /home/john/Documents/Snippets/Rust/Cargo.toml, Some(Version { major: 1, minor: 81, patch: 0 }): Failed to run `cd \"/home/john/Documents/Snippets/Rust\" && RUSTUP_TOOLCHAIN=\"/home/john/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\" \"/home/john/.cargo/bin/cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/john/Documents/Snippets/Rust/Cargo.toml\" \"--filter-platform\" \"x86_64-unknown-linux-gnu\"`: `cargo metadata` exited with an error: error: failed to parse manifest at `/home/john/Documents/Snippets/Rust/Cargo.toml`\n\nCaused by:\n no targets specified in the manifest\n either src/lib.rs, src/main.rs, a [lib] section, or [[bin]] section must be present\n```\n\nI not sure how to fix this.\n\nI would like to get the VSCode debugger to work for launch debugging, attach debugging and launch and attach debugging for rust running inside a docker container. This will be a good setup for getting started I believe.\n\nThis is my VSCode debugger configuration...\n\n```\n{\n\t// Use IntelliSense to learn about possible attributes.\n\t// Hover to view descriptions of existing attributes.\n\t// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"type\": \"lldb\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"name\": \"Debug\",\n\t\t\t\"program\": \"${workspaceFolder}/hello-world\",\n\t\t\t\"args\": [],\n\t\t\t\"cwd\": \"${workspaceFolder}\"\n\t\t}\n\t]\n}\n\n```\n\nAny help and advice will be most appreciated.", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-07T00:48:29.264453Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20581829", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/84569138-d888-4799-ad96-f97c602f03d6" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/2a7c10b9-80e3-45c0-8cab-a5cf1cea0a98", "actor": "https://programming.dev/u/BB_C", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20273353", "attributedTo": "https://programming.dev/u/BB_C", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "kdl 6.0.0-alpha.1 (first version with a KDL v2 implementation)", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://github.com/kdl-org/kdl-rs/blob/f67e3d2998dcf0d198b4d03be7b23062cab21723/CHANGELOG.md", "mediaType": "text/html; charset=utf-8", "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/e25d8116-9344-4be4-9a4d-250e29c66e43.png" }, "sensitive": false, "published": "2024-10-07T00:32:56.093317Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20273353", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/d636388e-fe96-4891-90c7-11e21ae8e148" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/ff1690a3-5eb0-4cf2-957b-77e00128e9c9", "actor": "https://infosec.pub/u/Doods", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://infosec.pub/post/18414382", "attributedTo": "https://infosec.pub/u/Doods", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "rust_analyzer takes forever to load; `cargo check` is instant.", "cc": [], "content": "<p>I was using <a href=\"iced.rs\" rel=\"nofollow\">Iced</a> as a dependency, but wanted to tweak its source code for some reason, so I jumped into the folder where cargo downloads dependencies, and went into iced_wgpu 13.5 (I think that’s the version).</p>\n<p>I could make a change, then run</p>\n<p><code>cargo clean -p iced_wgpu &amp;&amp; cargo check</code></p>\n<p>in my other project for instant feedback, yet it took rust_analyzer <em>at least</em> 5 whole minutes to stop hallucinating.</p>\n<p>Can I disable some functionality of <code>rust_analyzer</code>? I only use it for jump-to-definition, linting and syntax highlighting; I don’t even use autocomplete.</p>\n<h1>Setup:</h1>\n<ul>\n<li>\n<p>Desktop that thermally throttles only when both the IGPU and the CPU are under full load, and is cool otherwise.</p>\n</li>\n<li>\n<p>CPU: Intel I5-7500</p>\n</li>\n<li>\n<p>RAM: 8 GiB DDR-4</p>\n</li>\n<li>\n<p>Editor: NVIM v0.11.0-dev | Build type: RelWithDebInfo | LuaJIT 2.1.0-beta3 (I had the same issue with other versions as well).</p>\n</li>\n</ul>\n<h1>TLDR</h1>\n<p>What can I disable in rust_analyzer to boost performance while maintaining jump-to-definition, linting and syntax-highlighting, or what can I do to boost rust_analyzer for big projects in general?</p>\n", "mediaType": "text/html", "source": { "content": "I was using [Iced](iced.rs) as a dependency, but wanted to tweak its source code for some reason, so I jumped into the folder where cargo downloads dependencies, and went into iced_wgpu 13.5 (I think that's the version).\n\nI could make a change, then run\n\n`cargo clean -p iced_wgpu && cargo check`\n\nin my other project for instant feedback, yet it took rust_analyzer *at least* 5 whole minutes to stop hallucinating.\n\nCan I disable some functionality of `rust_analyzer`? I only use it for jump-to-definition, linting and syntax highlighting; I don't even use autocomplete.\n\n# Setup:\n* Desktop that thermally throttles only when both the IGPU and the CPU are under full load, and is cool otherwise.\n\n* CPU: Intel I5-7500\n* RAM: 8 GiB DDR-4\n* Editor: NVIM v0.11.0-dev | Build type: RelWithDebInfo | LuaJIT 2.1.0-beta3 (I had the same issue with other versions as well).\n\n\n# TLDR\nWhat can I disable in rust_analyzer to boost performance while maintaining jump-to-definition, linting and syntax-highlighting, or what can I do to boost rust_analyzer for big projects in general?", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-04T07:44:46.769539Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://infosec.pub/post/18414382", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/ddf35983-7f63-4b8d-bbee-9decb9409cce" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/963ac817-cf6f-4ec3-9ee6-9f398e6b18d7", "actor": "https://lemmy.world/u/InternetCitizen2", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20479742", "attributedTo": "https://lemmy.world/u/InternetCitizen2", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Do people use Cargo?", "cc": [], "content": "<p>I really like the idea of a package/dependency manager. It just seems that when ever I am reading a tutorial and they want to import something that is not standard they say write this in to your TOMOL not cargo install it. Like when reading python docs they all say to use pip or something. Sorry it just seems that Cargo is somewhat overlooked or is it just my perception?</p>\n", "mediaType": "text/html", "source": { "content": "I really like the idea of a package/dependency manager. It just seems that when ever I am reading a tutorial and they want to import something that is not standard they say write this in to your TOMOL not cargo install it. Like when reading python docs they all say to use pip or something. Sorry it just seems that Cargo is somewhat overlooked or is it just my perception? ", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-04T01:38:19.762426Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20479742", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/4bdb8a02-fc78-4112-9756-dea77f32df98" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/5f6107cd-c918-4df4-b6be-101f7c7737bf", "actor": "https://programming.dev/u/blaze", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20143262", "attributedTo": "https://programming.dev/u/blaze", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Tauri 2.0 has just been released", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://v2.tauri.app/blog/tauri-20/", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/1abc83f1-c1a7-462a-b3f9-1b3e2531e2e1.png" }, "sensitive": false, "published": "2024-10-02T16:35:27.910142Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20143262", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/ed84144e-f001-4198-8e5b-d22733c1ab30" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/1419ba7c-4143-4d6d-9372-c7d4802acfa1", "actor": "https://mastodon.social/users/gulia", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://mastodon.social/users/gulia/statuses/113236698692433605", "attributedTo": "https://mastodon.social/users/gulia", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "C++ VS Rust", "cc": [], "content": "<p>C++ VS Rust</p>\n<p><a href=\"https://brevzin.github.io/c++/2024/09/30/annotations/\" rel=\"nofollow\">https://brevzin.github.io/c++/2024/09/30/annotations/</a></p>\n<p><a href=\"https://mastodon.social/@cppguide\" rel=\"nofollow\">@cppguide</a> <a href=\"https://programming.dev/c/rust\" rel=\"nofollow\">@rust</a></p>\n", "mediaType": "text/html", "source": { "content": "C++ VS Rust\n\n[https://brevzin.github.io/c++/2024/09/30/annotations/](https://brevzin.github.io/c++/2024/09/30/annotations/)\n\n[@cppguide](https://mastodon.social/@cppguide) [@rust](https://programming.dev/c/rust)", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-10-02T07:41:39Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://mastodon.social/users/gulia/statuses/113236698692433605", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/a49e374d-0ac7-4bfe-99fc-94d364f4136b" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/20fba82c-2d35-4c95-85f3-d4ffacd6412e", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20125435", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "This Development-cycle in Cargo: 1.82 | Inside Rust Blog", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://blog.rust-lang.org/inside-rust/2024/10/01/this-development-cycle-in-cargo-1.82.html", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/431717ff-93c3-432b-9c4c-21bb65105690.jpeg" }, "sensitive": false, "published": "2024-10-02T05:31:16.665141Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20125435", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/53c9823c-3b7d-4b1e-8638-67499cd10039" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/7471ecce-a10e-4601-be9e-94ea2058e3f6", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20091559", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Rust Analyzer Changelog #253", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://rust-analyzer.github.io/thisweek/2024/09/30/changelog-253.html", "mediaType": null, "type": "Link" } ], "sensitive": false, "published": "2024-10-01T09:34:13.260479Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20091559", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/aba2645d-587a-45be-a547-cca31b9e2b96" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/e4af4d31-bae3-4212-9f2a-72d41a934bb9", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20086770", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Code Generation in Rust vs C++26", "cc": [], "content": "<p>This is a blog post that really is about C++, but with a look at how Rust does things. So, this is an interesting C++/Rust comparison for once.</p>\n", "mediaType": "text/html", "source": { "content": "This is a blog post that really is about C++, but with a look at how Rust does things. So, this is an interesting C++/Rust comparison for once. ", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://brevzin.github.io/c++/2024/09/30/annotations/", "mediaType": null, "type": "Link" } ], "sensitive": false, "published": "2024-10-01T05:56:11.715435Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20086770", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/7075ad87-55e6-4471-9730-2a1ead68419d" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/d9ecbde6-c862-4bc3-8efc-7bb579baffc7", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20045263", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "GitHub - RReverser/serdebug: Serde-based replacement for #[derive(Debug)]", "cc": [], "content": "<p>Last week I basically duplicated the serialization code to provide better debug output… today, I see this pass in my Mastodon feed. 😀\nWell… what are the odds… most likely close to 100% according to how the universe seems to operate.</p>\n", "mediaType": "text/html", "source": { "content": "Last week I basically duplicated the serialization code to provide better debug output.... today, I see this pass in my Mastodon feed. 😀 \nWell... what are the odds... most likely close to 100% according to how the universe seems to operate. ", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://github.com/RReverser/serdebug", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/fcb2360d-56ca-4e99-9472-28abe6c464ad.png" }, "sensitive": false, "published": "2024-09-30T08:04:09.978832Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20045263", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/841593f6-e8de-4e83-be25-153daa009123" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/582d42ca-ef93-417f-840a-3692dbb73d00", "actor": "https://programming.dev/u/secana", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20017937", "attributedTo": "https://programming.dev/u/secana", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Kellnr v5.2.6 released", "cc": [], "content": "<p>Kellnr, the crate registry for Rust got an update. The latest version contains bug fixes and dependency updates. If you are interested in hosting private crates that must not be on crates.io, check it out.</p>\n", "mediaType": "text/html", "source": { "content": "Kellnr, the crate registry for Rust got an update. The latest version contains bug fixes and dependency updates. If you are interested in hosting private crates that must not be on crates.io, check it out.", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://kellnr.io/", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/8fb4a15d-7a53-4d14-a27e-631bb0b9dd16.png" }, "sensitive": false, "published": "2024-09-29T15:37:16.635523Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20017937", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/2e5b91d3-2a26-43fe-ab17-0ae144a47fda" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/65864554-b3ad-46f6-91e6-27e595646e5c", "actor": "https://programming.dev/u/secana", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/20012459", "attributedTo": "https://programming.dev/u/secana", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "What are you working on this week? (Sep. 29, 2024)", "cc": [], "content": "<p>Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?</p>\n", "mediaType": "text/html", "source": { "content": "Hi rustaceans! What are you working on this week? Did you discover something new, you want to share?", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-09-29T13:53:38.561665Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/20012459", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/24334973-c15f-448e-94d0-97bbacce8eec" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/fbe72b85-76d8-4845-8bf6-de18bd7e191e", "actor": "https://leminal.space/u/hallettj", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://leminal.space/post/10779898", "attributedTo": "https://leminal.space/u/hallettj", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "“Truly Hygienic” Let Statements in Rust", "cc": [], "content": "<p>A short post on how variable names can leak out of macros if there is a name collision with a constant. I thought this was a delightful read!</p>\n", "mediaType": "text/html", "source": { "content": "A short post on how variable names can leak out of macros if there is a name collision with a constant. I thought this was a delightful read!", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://sabrinajewson.org/blog/truly-hygienic-let", "mediaType": null, "type": "Link" } ], "sensitive": false, "published": "2024-09-28T21:33:04.941106Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://leminal.space/post/10779898", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/26bc93dd-a498-4b1a-95e6-356738611da7" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/e826e08c-7146-4440-9c85-368e57b33cbf", "actor": "https://lemmy.world/u/u_1f914", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20289936", "attributedTo": "https://lemmy.world/u/u_1f914", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Making overwrite opt-in #crazyideas | Baby Steps", "cc": [], "content": "", "mediaType": "text/html", "source": { "content": "", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://smallcultfollowing.com/babysteps/blog/2024/09/26/overwrite-trait/", "mediaType": null, "type": "Link" } ], "sensitive": false, "published": "2024-09-28T20:19:17.191044Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20289936", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/4b08cb5d-cf55-43bc-b271-e768b0d68adb" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/f5ad9a79-f35f-4f33-9116-b9d7058835fd", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/19919104", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Google's Shift to Rust Programming Cuts Android Memory Vulnerabilities by 52%", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://thehackernews.com/2024/09/googles-shift-to-rust-programming-cuts.html", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/e56bef2b-6f22-4824-83ed-b07dcda92de6.webp" }, "sensitive": false, "published": "2024-09-27T09:20:41.375832Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/19919104", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/40022bf8-2295-4d57-b1d1-bac0c4ba2083" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/9c8381d1-7e8d-4b9c-9d0f-282af4d50754", "actor": "https://lemmy.world/u/u_1f914", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20224906", "attributedTo": "https://lemmy.world/u/u_1f914", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Return type notation MVP: Call for testing! | Inside Rust Blog", "cc": [], "content": "", "mediaType": "text/html", "source": { "content": "", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://blog.rust-lang.org/inside-rust/2024/09/26/rtn-call-for-testing.html", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/31b231fb-9ab8-4fde-8011-dc5ec99d0cdb.jpeg" }, "sensitive": false, "published": "2024-09-26T23:25:28.635238Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20224906", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/a21771e7-0796-475d-947b-ff2670081ed9" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/1a958bb0-c82b-47ab-b01a-7d07a7782cfb", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/19746810", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Gitoxide August 2024 Progress report", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://github.com/Byron/gitoxide/discussions/1602", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/b8c6e81c-9059-4a45-ace3-e484693e0e46.png" }, "sensitive": false, "published": "2024-09-23T05:59:20.477226Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/19746810", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/742a6f74-873f-401a-8015-7ac6d48bae6e" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/2b1c7218-41db-4ef9-aa85-4fae5a829948", "actor": "https://lemmy.sdf.org/u/polaris64", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.sdf.org/post/22693557", "attributedTo": "https://lemmy.sdf.org/u/polaris64", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Blog: creating Verlet Physics Playground and converting to Rust", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://blog.polaris64.net/post/verlet-physics-playground/", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://lemmy.sdf.org/pictrs/image/2416142e-35e0-4e2a-a39a-dc9f49a27b90.png" }, "sensitive": false, "published": "2024-09-22T11:29:17.048599Z", "updated": "2024-09-24T11:21:51.388457Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.sdf.org/post/22693557", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/6396cf74-9291-4eae-bc09-fcbd406293e8" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/a09e665f-88f7-46f7-b2f8-0f2ec422c4ab", "actor": "https://lemmy.world/u/Commodore", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/20010618", "attributedTo": "https://lemmy.world/u/Commodore", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Need some advice about creating game overlay in Linux", "cc": [], "content": "<p>Hi. I’ve been learning Rust for a while, and I want to take on an actual project now to learn even more. I need to be pointed in the right direction for one aspect of the affair, and I hope someone here can help me.</p>\n<p>I want to create a deck tracker for Hearthstone that runs natively in Linux. This is, on the back end, a fairly simple matter of parsing a constantly updated file that tracks everything that happens in the game. On the front end, however, I want to create a window that sits on top of the fullscreen Hearthstone window and shows me stuff. The “stuff” doesn’t have to be images or anything fancy, I’ll take whatever I can get, but I don’t know how to get started on this part.</p>\n<p>So the task is as follows: Create an overlay on top of the fullscreen Hearthstone client, preferably under Wayland, and update it constantly with new information about cards drawn, cards left in deck, that sort of thing.</p>\n<p>How do I tackle this problem? Are there any crates that’ll let me create such a window and render stuff to it? How would <em>you</em> approach the problem?</p>\n<p>Thanks in advance.</p>\n", "mediaType": "text/html", "source": { "content": "Hi. I've been learning Rust for a while, and I want to take on an actual project now to learn even more. I need to be pointed in the right direction for one aspect of the affair, and I hope someone here can help me.\n\nI want to create a deck tracker for Hearthstone that runs natively in Linux. This is, on the back end, a fairly simple matter of parsing a constantly updated file that tracks everything that happens in the game. On the front end, however, I want to create a window that sits on top of the fullscreen Hearthstone window and shows me stuff. The \"stuff\" doesn't have to be images or anything fancy, I'll take whatever I can get, but I don't know how to get started on this part.\n\nSo the task is as follows: Create an overlay on top of the fullscreen Hearthstone client, preferably under Wayland, and update it constantly with new information about cards drawn, cards left in deck, that sort of thing.\n\nHow do I tackle this problem? Are there any crates that'll let me create such a window and render stuff to it? How would *you* approach the problem?\n\nThanks in advance.", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-09-21T05:41:14.299166Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/20010618", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/d6c05918-27e1-43d9-bfa9-dafe7706e768" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/62ac7d7a-7009-4a08-950e-88f632d7503a", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/19577851", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Release 0.13.0 · iced-rs/iced · GitHub", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://github.com/iced-rs/iced/releases/tag/0.13.0", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/4a51bf59-50dc-41c2-90a4-f1f712a99610.png" }, "sensitive": false, "published": "2024-09-19T05:33:44.965086Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/19577851", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/b0b65d99-d968-49a7-870c-23a24db1ce46" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/17b16172-e10c-448a-9205-da093e0fd9e5", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/19453580", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "[BLOG] Why Rust mutexes look like they do - Cliffle", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://cliffle.com/blog/rust-mutexes/", "mediaType": null, "type": "Link" } ], "sensitive": false, "published": "2024-09-16T05:31:45.020432Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/19453580", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/c9fb1d63-1adb-496e-88a2-c05a11ab11c4" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/026ba72f-3533-4118-bbe3-75f1ccd37b77", "actor": "https://programming.dev/u/martinn", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/19418573", "attributedTo": "https://programming.dev/u/martinn", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "I made a tool to aggregate git blame stats across any repo", "cc": [], "content": "<p>I’ve always been curious about this. If I were to take a snapshot of a git repo at a particular point in time, who would be the top contributors by active lines of code? And then, what type of files have they contributed the most? So I built this little tool.</p>\n<p>I’ve been wanting to learn rust for quite some time now and this was one of my first projects in it. It was a lot of fun!</p>\n<p>It uses <code>git</code> under the hood to obtain the information and it’s nothing fancy, but keen to hear what you think.</p>\n", "mediaType": "text/html", "source": { "content": "I've always been curious about this. If I were to take a snapshot of a git repo at a particular point in time, who would be the top contributors by active lines of code? And then, what type of files have they contributed the most? So I built this little tool.\n\nI've been wanting to learn rust for quite some time now and this was one of my first projects in it. It was a lot of fun!\n\nIt uses `git` under the hood to obtain the information and it's nothing fancy, but keen to hear what you think. ", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://github.com/martinn/repoblame", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/8292e136-147a-406d-a04d-d528eb9a699d.png" }, "sensitive": false, "published": "2024-09-15T07:40:02.754108Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/19418573", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/cc63196e-55ab-4b00-8a8c-180b05da34a8" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/a20e1013-6ce7-4694-b297-57d6f3f901b0", "actor": "https://mathstodon.xyz/users/xameer", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://mathstodon.xyz/users/xameer/statuses/113128420039214369", "attributedTo": "https://mathstodon.xyz/users/xameer", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "#rust analyzer question for #emacs folks", "cc": [], "content": "<p><a href=\"https://mathstodon.xyz/tags/rust\" rel=\"nofollow\">#rust</a> analyzer question for <a href=\"https://mathstodon.xyz/tags/emacs\" rel=\"nofollow\">#emacs</a> folks<br />\nIn client more I see run and debug<br />\nBut gui emacs I don’t …<br />\nwhy<br />\npfa</p>\n<p><a href=\"https://programming.dev/c/rust\" rel=\"nofollow\">@rust</a></p>\n", "mediaType": "text/html", "source": { "content": "[\\#rust](https://mathstodon.xyz/tags/rust) analyzer question for [#emacs](https://mathstodon.xyz/tags/emacs) folks \nIn client more I see run and debug \nBut gui emacs I don't .. \nwhy \npfa\n\n[@rust](https://programming.dev/c/rust)", "mediaType": "text/markdown" }, "attachment": [ { "href": "https://media.mathstodon.xyz/media_attachments/files/113/128/419/818/817/133/original/66c84ceb03e62d6c.png", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/23fba923-6718-4a4e-b460-5ff473810cb8.png" }, "sensitive": false, "published": "2024-09-13T04:44:58Z", "updated": "2024-09-13T08:09:46Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://mathstodon.xyz/users/xameer/statuses/113128420039214369", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/0bf8ade6-674a-425d-ab17-273f3879983e" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/7cdc07f8-19da-4808-b059-449724a455a6", "actor": "https://lemmy.ml/u/orsinium", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.ml/post/20171762", "attributedTo": "https://lemmy.ml/u/orsinium", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "textdistance.rs, Rust crate with 25+ algorithms for comparing strings. Now with no_std support!", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://github.com/life4/textdistance.rs", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/eaab40c0-b365-44e2-bda1-cce22df9b131.png" }, "sensitive": false, "published": "2024-09-11T06:43:57.083485Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.ml/post/20171762", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/f6f72c85-0e33-49ff-8229-7fea81108180" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/013a3973-f268-48a3-bbb7-7c3899b7ee78", "actor": "https://lemmy.ml/u/orsinium", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.ml/post/20171761", "attributedTo": "https://lemmy.ml/u/orsinium", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "GitHub - life4/textdistance.rs: 🦀📏 Rust library to compare strings (or any sequences). 25+ algorithms, pure Rust, common interface, Unicode support.", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://github.com/life4/textdistance.rs", "mediaType": null, "type": "Link" } ], "image": { "type": "Image", "url": "https://programming.dev/pictrs/image/8da0b932-b42e-4a7a-98a2-3a89fb145b2f.png" }, "sensitive": false, "published": "2024-09-11T06:42:51.341169Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.ml/post/20171761", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/dc5eed67-00d8-4390-a0ee-f4348a6ed01e" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/72d0f33b-da07-4661-b1ea-cfb823755552", "actor": "https://lemmy.world/u/thevoidzero", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://lemmy.world/post/19615564", "attributedTo": "https://lemmy.world/u/thevoidzero", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "[Help] Is there a way to detect all structs in the current crate that implement a certain trait?", "cc": [], "content": "<p>Hi all.</p>\n<p>I want to develop a plugin system within my program, and I have a trait that functions defined by plugins should implement.</p>\n<p>Currently, my code gets all the functions in a HashMap and then calls them by their name. Problem is, I have to create that hashmap myself by inserting every function myself.</p>\n<p>I would really appreciate it if there was a way to say, suppose, all pub members of <code>mod functions::</code> that implement this <code>trait PluginFunction</code> call <code>register(hashmap)</code> function. So as I add more functions as <code>mod</code> in <code>functions</code> it’ll be automatically added on compile.</p>\n<p>Pseudocode:</p>\n<p>Files:</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">src/\n</span><span style=\"color:#323232;\">├── attrs.rs\n</span><span style=\"color:#323232;\">├── functions\n</span><span style=\"color:#323232;\">│   ├── attrs.rs\n</span><span style=\"color:#323232;\">│   ├── export.rs\n</span><span style=\"color:#323232;\">│   └── render.rs\n</span><span style=\"color:#323232;\">├── functions.rs\n</span><span style=\"color:#323232;\">├── lib.rs\n</span></pre>\n<p>Basically, in <code>mod functions</code> I want:</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">impl AllFunctions{\n</span><span style=\"color:#323232;\"> pub fn new() -&gt; Self {\n</span><span style=\"color:#323232;\"> let mut functions_map = HashMap::new();[[\n</span><span style=\"color:#323232;\"> register_all!(crate::functions::* implementing PluginFunction, &amp;mut functions_map);\n</span><span style=\"color:#323232;\"> Self { function_map }\n</span><span style=\"color:#323232;\"> }\n</span><span style=\"color:#323232;\">}\n</span></pre>\n<p>Right now I’m doing:</p>\n<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">impl AllFunctions{\n</span><span style=\"color:#323232;\"> pub fn new() -&gt; Self {\n</span><span style=\"color:#323232;\"> let mut functions_map = HashMap::new();[[\n</span><span style=\"color:#323232;\"> crate::functions::attrs::PrintAttr{}.register(&amp;mut functions_map);\n</span><span style=\"color:#323232;\"> crate::functions::export::ExportCSV{}.register(&amp;mut functions_map);\n</span><span style=\"color:#323232;\"> crate::functions::render::RenderText{}.register(&amp;mut functions_map);\n</span><span style=\"color:#323232;\"> // More as I add more functions\n</span><span style=\"color:#323232;\"> Self { function_map }\n</span><span style=\"color:#323232;\"> }\n</span><span style=\"color:#323232;\">}\n</span></pre>\n", "mediaType": "text/html", "source": { "content": "Hi all. \n\nI want to develop a plugin system within my program, and I have a trait that functions defined by plugins should implement.\n\nCurrently, my code gets all the functions in a HashMap and then calls them by their name. Problem is, I have to create that hashmap myself by inserting every function myself.\n\nI would really appreciate it if there was a way to say, suppose, all pub members of `mod functions::` that implement this `trait PluginFunction` call `register(hashmap)` function. So as I add more functions as `mod` in `functions` it'll be automatically added on compile.\n\nPseudocode:\n\nFiles:\n```\nsrc/\n├── attrs.rs\n├── functions\n│   ├── attrs.rs\n│   ├── export.rs\n│   └── render.rs\n├── functions.rs\n├── lib.rs\n```\n\nBasically, in `mod functions` I want:\n```\nimpl AllFunctions{\n pub fn new() -> Self {\n let mut functions_map = HashMap::new();[[\n register_all!(crate::functions::* implementing PluginFunction, &mut functions_map);\n Self { function_map }\n }\n}\n```\nRight now I'm doing:\n```\nimpl AllFunctions{\n pub fn new() -> Self {\n let mut functions_map = HashMap::new();[[\n crate::functions::attrs::PrintAttr{}.register(&mut functions_map);\n crate::functions::export::ExportCSV{}.register(&mut functions_map);\n crate::functions::render::RenderText{}.register(&mut functions_map);\n // More as I add more functions\n Self { function_map }\n }\n}\n```\n", "mediaType": "text/markdown" }, "attachment": [], "sensitive": false, "published": "2024-09-10T17:00:08.514346Z", "updated": "2024-09-10T17:20:22.974743Z", "language": { "identifier": "en", "name": "English" }, "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://lemmy.world/post/19615564", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/362bad52-7a38-47f2-a17b-0b0080b7bb60" }, { "actor": "https://programming.dev/c/rust", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "id": "https://programming.dev/activities/create/ed7405fb-cc65-4dc6-99ab-4e8f8bcd4fff", "actor": "https://programming.dev/u/snaggen", "to": [ "https://www.w3.org/ns/activitystreams#Public" ], "object": { "type": "Page", "id": "https://programming.dev/post/19143991", "attributedTo": "https://programming.dev/u/snaggen", "to": [ "https://programming.dev/c/rust", "https://www.w3.org/ns/activitystreams#Public" ], "name": "Linux-for-Rust or Rust-for-Linux [LWN.net]", "cc": [], "mediaType": "text/html", "attachment": [ { "href": "https://lwn.net/Articles/987967/", "mediaType": null, "type": "Link" } ], "sensitive": false, "published": "2024-09-08T16:31:38.450695Z", "audience": "https://programming.dev/c/rust", "tag": [ { "href": "https://programming.dev/post/19143991", "name": "#rust", "type": "Hashtag" } ] }, "cc": [ "https://programming.dev/c/rust" ], "type": "Create", "audience": "https://programming.dev/c/rust" }, "cc": [ "https://programming.dev/c/rust/followers" ], "type": "Announce", "id": "https://programming.dev/activities/announce/create/3d2eed83-7618-4e85-b5fb-1826997529c7" } ] }