There are two pieces of code here in Rust, Can you find out the difference between them?
Reddit » The Rust Programming Language
by /u/veakorg
2h ago
There are two pieces of code here in Rust, Can you find out the difference between them? First code let fmt="%Y-%m-%d %H:%M:%S"; let x: String= format!("{}\0", fmt); let format = x.as_bytes().as_ptr(); Second code let fmt="%Y-%m-%d %H:%M:%S"; let format = format!("{}\0", fmt).as_bytes().as_ptr(); As I use them, I find that they have different results for my needs, but I don't know why. submitted by /u/veakorg [visit reddit] [comments ..read more
Visit website
How often do you create traits in your programs?
Reddit » The Rust Programming Language
by /u/officiallyaninja
2h ago
I'm a hobbyist dev for now, and have had (and still do have) a lot of bad habits. One of those was creating unnecessary class hierarchies for all my projects. I didn't realize they were unnecessary at the time, it just felt right. But since learning rust ive properly understood composition and use it almost all the time. I can't think of a time I've actually created a trait for any reason other than learning about them. So for those of you that do create and sue traits, what kind of situations do they come up? submitted by /u/officiallyaninja [visit reddit] [comments ..read more
Visit website
How often do you create traits in your programs?
Reddit » The Rust Programming Language
by /u/officiallyaninja
2h ago
I'm a hobbyist dev for now, and have had (and still do have) a lot of bad habits. One of those was creating unnecessary class hierarchies for all my projects. I didn't realize they were unnecessary at the time, it just felt right. But since learning rust ive properly understood composition and use it almost all the time. I can't think of a time I've actually created a trait for any reason other than learning about them. So for those of you that do create and sue traits, what kind of situations do they come up? submitted by /u/officiallyaninja [visit reddit] [comments ..read more
Visit website
I wrote an easy-to-use database API library based on libsql / sqlite
Reddit » The Rust Programming Language
by /u/Milen_Dnv
2h ago
I made the rs-aio-db which allows you to create and manage databases and it's data by just using dead simple rust API. Does everything automatically (like migrations) and also supports in-memory and local database types (soon will support remote TursoDB as well). It's very fast and highly concurrent since I added connection pooling and retries if a transaction fails if the db is locked. Also includes an ORM-like API for querying and managing data. I am using it in production for storing the cached requests of a proxy server with lot of traffic and I pretty happy with what I made. I made this ..read more
Visit website
Studies projects
Reddit » The Rust Programming Language
by /u/Key_Curve_7333
3h ago
Hello there ? I need some help or advice. For my studies, I need to create a web app with a CMS (not a heavy CMS, just something for blog administration or similar). I started learning Rust 3 months ago and I love it ❤️. For this year's project, I want to create something ethical and ecological to present to my master's program in three years. My project involves blockchain and IoT, similar to Nodle, for gathering ecological data with IoT sensors. This year, I just want to create a website to present my project to the jury. I plan to develop an API with Rust, use blockchain for the database ..read more
Visit website
[Rocket + Diesel + Postgres] How to run postgres migrations in rocket way with diesel?
Reddit » The Rust Programming Language
by /u/zxcqirara
4h ago
I found examples for mysql and for sqlite. MySQL example worked for me but it doesn't run migrations. Sqlite does but when I trying its code, it throws error in Db struct line (github sqlite example) and says that it can't be PgConnection like in sqlite example, only PgPool-like. But idk how to run migrations with it submitted by /u/zxcqirara [visit reddit] [comments ..read more
Visit website
Caliptra, a Root of Trust project by CHIPS Alliance, open sources their Rust firmware
Reddit » The Rust Programming Language
by /u/jahmez
6h ago
submitted by /u/jahmez [visit reddit] [comments ..read more
Visit website
Should I use a Rust server API or FFI with C#?
Reddit » The Rust Programming Language
by /u/boumboumjack
7h ago
I am working on my own project. The base is a lot of auto generated, imbricated, nested, hell, probably to messy classes in C# and I was planning to do a bunch of calculation in Rust, because Rust looks cool and I don't find computing with C# sexy enough. Now, I started experimenting, and obviously, the interface between the two language using FFI is not that simple. I could pass some values of course, and everything compile together smoothly in VS code. (Though no debugging in Rust). But I couldn't even pass a json string. I look at the project C# FFI, but ended not that convinced. It seems ..read more
Visit website
A
by
ago
A ..read more
Visit website
A
by
ago
A ..read more
Visit website

Follow Reddit » The Rust Programming Language on FeedSpot

Continue with Google
Continue with Apple
OR