126
60
Confession (feddit.nu)
submitted 2 years ago* (last edited 2 years ago) by SufferingSteve@feddit.nu to c/rust@lemmy.ml

I have been programming in Rust for about 8 years now. I love the language. But I feel I have some confessions I must make.

  1. I don't know if I use tabs or spaces in my final code. I just assume that it all get solved correctly by cargo fmt. I don't even understand that people have been arguing about this for real? I vaguely remember this being important in C and C++, but I am hoping I never go back to those dark days.

  2. I never do linebreaks, not even when adding my semicolons. I hit ":w" and if shit doesn't move around on my screen, I fucked up somewhere.

  3. The only lifetime I ever use is '_, 'a or 'static otherwise I give up

  4. Wtf is the 'de lifetime in serde deserialize??

  5. Rocket is the best web server

  6. I actively chose software written in Rust over other software, even if it's not better, and I argue that it is.

Okay, got that of my chest. Never dared telling anyone this before. Feels scary

127
8
submitted 2 years ago by commander@lemmings.world to c/rust@lemmy.ml

I came from Java, so it kind of makes sense.

I'm glad the Rust devs thought to allow disabling non-snake_case warnings.

This language is actually really great and versatile. (I also use tabs instead of spaces)

128
49
submitted 2 years ago by Ephera@lemmy.ml to c/rust@lemmy.ml
129
17
submitted 2 years ago* (last edited 2 years ago) by BitsandBytes@lemmy.world to c/rust@lemmy.ml

Hi there! Just wanted to share a project I worked on over the past 6 weeks. It is a boilerplate/template for a fairly secure API.

It now features:

  • An example API,
  • JWT auth (using APIkeys and username + password (+ 2 factor))
  • Key rotation,
  • Built-in HTTPS/HTTP2,
  • Multiple keys per account,
  • Usage tiers,
  • Role based access,
  • Healthcheck endpoint for monitoring and docker,
  • OpenAPI documentation generation,
  • And a lot more...

This was my first Rust project. I am always in for feedback :)

130
51
submitted 2 years ago by Ephera@lemmy.ml to c/rust@lemmy.ml
131
10
submitted 2 years ago by Zenlix@lemm.ee to c/rust@lemmy.ml

Are there some big projects/games that are released and made in bevy?

A lot of times tiny glade is mentioned, but I can not find a reliable source from the devs that it is made in bevy.

132
5
submitted 2 years ago by commander@lemmings.world to c/rust@lemmy.ml

I've used Godot, which works great but I'm wondering if there are other ways.

Does anyone have experience using Qt with Rust and Qt Designer?

Are there any other drag and drop options that you think are viable?

133
19
submitted 2 years ago* (last edited 2 years ago) by tracyspcy@lemmy.ml to c/rust@lemmy.ml
134
29
New Rust stable version (blog.rust-lang.org)
submitted 2 years ago by Zenlix@lemm.ee to c/rust@lemmy.ml
135
12
submitted 2 years ago by Tyedee@lemmy.world to c/rust@lemmy.ml

An interesting video about actor programming in Rust.

136
22
submitted 2 years ago by Zenlix@lemm.ee to c/rust@lemmy.ml

Iced, a popular GUI Crate, used by system76 for their new DE, is getting default animation support in the development branch. The animations are based on the lilt crate. As far as I know the only missing part that needs to be done is, adding animations to the default widgets.

I assume in the next release it will be shipped with animation support.

I am so happy that this is coming and look forward to see animations in my gui applications.

137
6
submitted 2 years ago by Aras@feddit.org to c/rust@lemmy.ml

cross-posted from: https://feddit.org/post/7326044

Inspired by Contex-Generic Programming, I made this macro, that allows you to write those generic implementations easily. This is kinda CGP, but simple and with better errors.

Ever repeat yourself implementing traits? Or wanted to easily swap out parts of your code, with (almost) no need to refactor? That is what this is for.

138
6
submitted 2 years ago by tglman@lemmy.ml to c/rust@lemmy.ml

New Release 1.6.0 of Persy single file embedded storage is out

Persy is a single file transactional embedded storage, is scope is become a base of persistent databases implementations or for simple low level database to embed in application.

This is a new minor release 1.6.0 that include a simple feature that allow to create snapshots from the commit of a transaction, release post with all details here: https://persy.rs/posts/persy-1.6.html

139
11
submitted 2 years ago by dessalines@lemmy.ml to c/rust@lemmy.ml
140
14
submitted 2 years ago by dontblink@feddit.it to c/rust@lemmy.ml

This is what I've found:

In C and C++, two different operators are used for calling methods: you use . if you’re calling a method on the object directly and -> if you’re calling the method on a pointer to the object and need to dereference the pointer first. In other words, if object is a pointer, object->something() is similar to (*object).something().

What about Rust?

Rust doesn’t have an equivalent to the -> operator. Instead, Rust has what is called automatic referencing and dereferencing.

In other words, the following are the same:

p1.distance(&p2); (&p1).distance(&p2); Note: this automatic referencing behavior works because methods have a clear receiver-the type of self. Given the receiver and name of a method, Rust can figure out definitively whether the method is reading (&self), mutating (&mut self), or consuming (self).

I am not sureI understood the note correctly, what does it mean that there is a clear receiver? Also, doesn't Rust actually have an operator for dereferencing (*) as well?

141
18
submitted 2 years ago by kionite231@lemmy.ca to c/rust@lemmy.ml
142
40
submitted 2 years ago by jplatte@discuss.tchncs.de to c/rust@lemmy.ml

axum is an ergonomic and modular web framework built with Tokio, Tower, and Hyper

143
45
submitted 2 years ago by cypherpunks@lemmy.ml to c/rust@lemmy.ml

It seems quite clear that rust users use hyper but few of them want to work on making it work for a C project like curl, and among existing curl users there is virtually no interest in hyper. The overlap in the Venn diagram of the two universes is not big enough.

144
20
Learning Rust (lemmy.ca)
submitted 2 years ago by kionite231@lemmy.ca to c/rust@lemmy.ml

Hello,

I have started learning Rust. I have only made a fibonaci series program so far but I would make more complex program as I progress in learning Rust :D

145
29
submitted 2 years ago* (last edited 2 years ago) by jplatte@discuss.tchncs.de to c/rust@lemmy.ml

axum is a web application framework that focuses on ergonomics and modularity.

Hey! If you're using axum, I would be happy if you tried the first release candidate of the upcoming v0.8.0, and shared any feedback you have. That's all :)

146
18
submitted 2 years ago by nutomic@lemmy.ml to c/rust@lemmy.ml
147
7
submitted 2 years ago* (last edited 2 years ago) by dontblink@feddit.it to c/rust@lemmy.ml

I am trying to understand the std::process::Termination trait.

As I'm not really used to read libraries, I took this as a challenge to try understanding a bit more about how to read them as well.

I think trying to build a library would give me better understanding, but for now...

Termination is quite easy, from the trait page I can see that this trait has single method: report, which returns an ExitCode.

pub trait Termination {
    fn report(self) -> ExitCode;
}

But when I try to dig in further and i read the page related to ExitCode, it confuses me a bit.

ExitCode is a struct, therefore it behaves like a type with many fields which define the types contained in the struct.

I cannot really understand what's the point of this type.. I don't see any fields defined in the struct and this part confuses me a lot:

The standard library provides the canonical SUCCESS and FAILURE exit codes as well as From for ExitCode for constructing other arbitrary exit codes.

I even thought this meant it was an enum which had the SUCCESS, FAILURE etc as variants, but this does not seem the case.

Can you help me to understand how this specific structs work, what exactly does it do and how I should read library pages like this one?

148
20
submitted 2 years ago* (last edited 2 years ago) by aclarke@lemmy.world to c/rust@lemmy.ml

I was recently furloughed from work, so in between job applications, I decided to polish off Sonarr support in my Managarr TUI. Thus, I'm very proud to announce the beta release of Managarr with Sonarr support!

TL;DR: Managarr is a TUI and CLI for managing your Servarr instances. As of now, it now supports both Radarr and Sonarr and all the features that are available in the UI are also available in the CLI for scripting and additional automation.

The new version has the following features:

  • Wider platform support (Windows, Mac, Linux, x86_64 and arm64)
  • View your library, downloads, blocklist, episodes
  • View details of a specific series, or episode including description, history, downloaded file info, or the credits
  • View your host and security configs from the CLI to programmatically fetch the API token, among other settings
  • Search your library
  • Add series to your library
  • Delete series, downloads, indexers, root folders, and episode files
  • Trigger automatic searches for series, seasons, or episodes
  • Trigger refresh and disk scan for series and downloads
  • Manually search for series, seasons, or episodes
  • Edit your series and indexers
  • Manage your tags
  • Manage your root folders
  • Manage your blocklist
  • View and browse logs, tasks, events queues, and updates
  • Manually trigger scheduled tasks
  • Manually trigger scheduled tasks
  • And more!

Here's some screenshots of the Sonarr tab:

Thanks to everyone's feedback when I first posted the alpha release here, this version sports a handful of additional performance improvements and platform support.

This is now technically in beta, so if anyone encounters any issues, please let me know!

149
13
submitted 2 years ago by tracyspcy@lemmy.ml to c/rust@lemmy.ml
150
10
submitted 2 years ago by tracyspcy@lemmy.ml to c/rust@lemmy.ml
view more: ‹ prev next ›

Rust Programming

9435 readers
1 users here now

founded 7 years ago
MODERATORS