Rust Programming

8879 readers
1 users here now

founded 6 years ago
MODERATORS
326
327
328
 
 

Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines.

Today, we're releasing version 0.61 of Nu. This release includes UI improvements, many bugfixes, improved glob support, and more.

329
 
 

I'd like to share a side-project that I finally got to a minimally-useful state this weekend, in case others find it useful

Repository: https://gitlab.com/jokeyrhyme/xdp-hook-rs

Features (as of 0.1.2):

  • monitors Location, ScreenCast, and RemoteDesktop portal sessions
  • triggers configured scripts/command when these sessions are created/closed

Example use case:

  • I'm using eww as my status bar across the top of my screen
  • I wanted to show/hide indicators whenever an application was using the ScreenCast portal (e.g. https://meet.jit.si/ or Zoom, or Teams, or whatever)
  • so I'm using xdp-hook to detect when any application creates a ScreenCast session, and update the state in eww accordingly so that a blinking widget is displayed/removed

Suggestions and code contributions are welcome :)

330
331
332
11
submitted 3 years ago* (last edited 3 years ago) by [email protected] to c/[email protected]
 
 

I've just published the stable version of pict-rs 0.3, and included a short write-up in the release description. Not much has changed since I posted about the betas, but check out the release anyway!

333
334
335
5
This Week in Rust 436 (this-week-in-rust.org)
submitted 3 years ago by [email protected] to c/[email protected]
336
 
 

I'm wondering if I should use Diesel in my project. I feel more comfortable writing SQL directly because I've used it before, but I've never done a database migration, I always deleted the database when I had to change it. So I don't know if I should learn Diesel to get migrations automatically or learn to do them directly in SQL. What would you recommend?

337
11
submitted 3 years ago* (last edited 3 years ago) by [email protected] to c/[email protected]
 
 

I don't know how to choose a templating engine. They all seem the same to me. What are the differences between askama, tera, handlebars? Are there any others?

338
339
340
341
342
 
 

I'm playing with the following code and can't seem to find an example where I can get the values of one of the coordinates.

enum Coordinates {
    Point1 { x: i32, y: i32 },
    Point2 { x: i32, y: i32 },
}
fn main() {
    let p1 = Coordinates::Point1{ x: 0, y: 45};
    let x = p1.x; //Doesn't work
}

How can I get the value of x or y?

343
344
345
346
347
 
 

Hey all! Just wanted to share a little fun side project I've been working on recently. It's an ecosystem similar to smol for writing async rust code, but the internals make no use of unsafe at all

repos:

  • async-join: a safe join_all function for Vec<Future>
  • polldance: a safe polling library built on unix poll with rustix for memory & io safety
  • foxtrot: a safe async reactor bulit on polldance and rustix
  • jitterbug: a safe async executor with multi-threaded work-stealing support

I'm not here to say "you should definitely use this" because I've wirtten zero tests, and I've made no effort to implement standard apis like AsyncRead, AsyncWrite, etc, but I wanted to show it is possible to build these things yourself

Shoutout to rustix for making socket programming safe and easy

348
349
 
 

What if Rust code could instead declare the context it needs, and the compiler took care of making sure that context was provided?

This is by far the most exciting reading I have had in the Rust ecosystem lately. Follow up and comment posts:

350
view more: ‹ prev next ›