Rust

6940 readers
28 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 2 years ago
MODERATORS
1
2
3
4
 
 

Cross posting from https://programming.dev/post/30565644

Hi everyone,

yesterday, we released iceoryx2 v0.6, an ultra-low latency inter-process communication framework for Rust, C and C++. Python support is also on the horizon. The main new feature is Request-Response-Stream, but there’s much more.

If you are into robotics, embedded real-time systems (especially safety-critical), autonomous vehicles or just want to hack around, iceoryx2 is built with you in mind.

Check out our release announcement for more details: https://ekxide.io/blog/iceoryx2-0-6-release

And the link to the project: https://github.com/eclipse-iceoryx/iceoryx2

5
6
7
8
 
 

So I've had this idea for an API for a while but the problem I keep coming back to is authentication. I'm using rocket to actually code it. I looked through the rocket docs and it looks like the closest thing to API key authentication it has are cookies.

I then went and looked at some other APIs to see if I can copy their layouts and it looks like a lot of them use an API key and then a secret API key for authentication. Did some more googling and stackoverflow said that it's more secure to use a pair like that.

So that leaves me with the actual question: how do you actually implement this feature? Do you just generate API keys and throw them a database to be looked up later? Should they be written/read to a file to be used later(probably not a good option I'd guess).

Just for reference I'm using rocket, sqlx and postgres.

9
10
11
12
9
submitted 1 week ago* (last edited 1 week ago) by SpiderUnderUrBed@lemmy.zip to c/rust@programming.dev
 
 

Hello, I am starting to learn and play around with tokio and multithreaded code. I am now playing around with websockets, I don't quite understand the difference between broadcast and mpsc, and when would you use either, I mean, I am assuming broadcast is intended for multiple clients, but multiple clients were able to connect to my mscp channel, and receive a bit of data (but it was weird and partial). So I don't quite get it.

13
 
 

cross-posted from: https://programming.dev/post/30061235

As part of this expansion, Qt Group will introduce new bridging technology that integrates Qt with any programming language of choice, initially including Rust, Python, .NET, Swift, and Kotlin/Java.

I'd really like to use Qt for GUI and HMI development for certified medical devices using embedded hardware, but wasn't looking forward to all the conventional C++ that would have entailed. Looks using Rust with Qt may get better soon?

Second source reporting from Qt World Summit in Munich:

Part of the thinking here is that C++ is regarded as an unsafe language whereas the languages supported by Qt Bridges are safe languages, potentially escaping the notion that because Qt is C++, it is not as safe to use.

14
15
16
11
submitted 2 weeks ago* (last edited 2 weeks ago) by catch22@programming.dev to c/rust@programming.dev
 
 

Hello, I'm fairly new to Rust and came across this. Can someone explain to me how the following example is able to infer the constant value from the array length passed in? At this point, inferred type generation for function calls are a bit hand wavy, to me, does anyone know of a resource that breaks down all the different ways they can be used (for instance in this example I hadn't seen them used for consts) and what their limitations are in Rust? I often run across a 'this type can not be inferred' error without really knowing why not and just throw in the type to make it go away.

Any other examples people could point me to would be appreciated as well.

Thanks!

#[derive(Debug)]
struct Buffer<T, const LENGTH: usize> {
    buf: [T; LENGTH],
}

impl<T, const LENGTH: usize> From<[T; LENGTH]> for Buffer<T, LENGTH> {
    fn from(buf: [T; LENGTH]) -> Self {
        Buffer { buf }
    }
}

fn main() {
    let buf = Buffer::from([0, 1, 2, 3,5]);
    dbg!(&buf);
}

Edit: for some reason, the code markdown is hiding things inside of the <>'s (at least on my lemmy viewing client)

17
 
 

Hey all, just looking for some advice. I'd like to do a WASM application, just generally like a calendar + notes app. I'd like it to work on mobile and desktop through the browser. It'll be served through Actix with Diesel for the backend. For the "frontend" I was thinking egui or leptos.

I'd like to avoid any JavaScript, so thought SSR might be the best approach.

Any thoughts/pitfalls? Should I look at something else for the frontend?

Its a lot of working parts for a calendar + notes app, but this will be a testing ground to see if I can get it all going :S

18
19
20
21
39
submitted 3 weeks ago* (last edited 3 weeks ago) by BitsandBytes@lemmy.world to c/rust@programming.dev
 
 

Hi there Rustians! A few months ago I posted about my hobby project. Just wanted to give an update.

Axium is a template for an API backend.

In the last few months I have added:

  • HTTP-cookie authentication (got it to work with a javascript site),
  • Password resetting,
  • User registration,
  • Example routes for interacting with S3 storage
  • Lots of input validation,
  • Caching,
  • Mailing (for the password reset and user registration).

I think that it is almost ready to be used as a backend for my website. Almost everything is marked off my wishlist, just need a few helper to help me check the security of the authentication and registration functions.

GitHub: https://github.com/Riktastic/Axium

22
 
 

This article delves into various techniques for reclaiming disk space from Cargo build artifacts.

23
48
Bevy 0.16 (bevyengine.org)
submitted 4 weeks ago by Phlimy@jlai.lu to c/rust@programming.dev
24
 
 

Kellnr, the registry to self host crates, has a new UI. I rewrote it to make it more consistent and responsive. Give it a try, if you want to host crates on your own infrastructure. https://kellnr.io/

25
 
 

Instead of emitting one giant crate containing everything, we tweaked our SQL-to-Rust compiler to split the output into many smaller crates. Each one encapsulating just a portion of the logic, neatly depending on each other, with a single top-level main crate pulling them all in.

view more: next ›