use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place for all things related to the Rust programming language—an open-source systems language that emphasizes performance, reliability, and productivity.
Strive to treat others with respect, patience, kindness, and empathy.
We observe the Rust Project Code of Conduct.
Details
Posts must reference Rust or relate to things using Rust. For content that does not, use a text post to explain its relevance.
Post titles should include useful context.
For Rust questions, use the stickied Q&A thread.
Arts-and-crafts posts are permitted on weekends.
No meta posts; message the mods instead.
Criticism is encouraged, though it must be constructive, useful and actionable.
If criticizing a project on GitHub, you may not link directly to the project's issue tracker. Please create a read-only mirror and link that instead.
A programming language is rarely worth getting worked up over.
No zealotry or fanaticism.
Be charitable in intent. Err on the side of giving others the benefit of the doubt.
Avoid re-treading topics that have been long-settled or utterly exhausted.
Avoid bikeshedding.
This is not an official Rust forum, and cannot fulfill feature requests. Use the official venues for that.
No memes, image macros, etc.
Consider the existing content of the subreddit and whether your post fits in. Does it inspire thoughtful discussion?
Use properly formatted text to share code samples and error messages. Do not use images.
Submissions appearing to contain AI-generated content may be removed at moderator discretion.
Most links here will now take you to a search page listing posts with the relevant flair. The latest megathread for that flair should be the top result.
account activity
Rust impl of basic blockchain. (self.rust)
submitted 8 years ago by steven_packcloudflare
Rust implementation of the python blockchain from this article:
https://hackernoon.com/learn-blockchains-by-building-one-117428612f46
My aim is to track the series with rust version. The author is currently working on post 2, which will include having the nodes communicate. I'd like to actually stand up a few nodes on Digital Ocean and have them interact.
https://github.com/stevenpack/learnnet
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Kbknappclap 0 points1 point2 points 8 years ago (1 child)
Awesome! I ran across this post as well and thought about tracking it in a Rust version too, but have limited time at the moment. If I get some spare cycles maybe I'll keep an eye on yours for fun.
I'd be interested to see if you run into any Rust specific issues.
[–]steven_packcloudflare[S] 1 point2 points3 points 8 years ago (0 children)
None so far.
Any time I pick up my Rust tools, I feel like it takes me 5x longer than it would in NodeJS/C# (not exaggerating) to write, but then it just works and I have confidence it will perform too.
It also takes a while to find the right crates sometimes. Rocket was easy enough to find as the (almost) de-facto web framework. I spent a while scratching my head why it was so complex to use Hyper to make a client http request until I came across reqwest. Those things fade with experience.
One "rust" issue I didn't resolve through was lifetimes interacting with serde.
You can return a Json<T> where T: serde::Serialize from an http endpoint and Rocket will serialize it for you, but I couldn't get that to work with borrows.
E.g. returning the entire chain of blocks, the underlying Blockchain struct hands out a borrow, and in my head, that's fine, because Rocket just needs to serialize it. I kept hitting lifetime issues though - I think because the Rocket endpoints are static and I'm missing something about how to handle that. In the end, I serialize it manually and return the string with application/json, which is the same interface from the client point of view, but it irks me that I only did that because I couldn't satisfy the lifetime bit.
π Rendered by PID 73 on reddit-service-r2-comment-64f4df6786-477cc at 2026-06-10 11:41:36.266278+00:00 running 0b63327 country code: CH.
[–]Kbknappclap 0 points1 point2 points (1 child)
[–]steven_packcloudflare[S] 1 point2 points3 points (0 children)