51
18
submitted 8 months ago by GnuLinuxDude@lemmy.ml to c/rust@lemmy.ml
52
6
submitted 8 months ago by kixik@lemmy.ml to c/rust@lemmy.ml

Anyone aware of a testing framework hopefully integrating well, and abstracting the shuttle testing functionality?

BTW I found rtest, but it doesn't in particular abstracts shuttle at all, it's a fixtures generic framework.

Planning to use shuttle to do MT testing targeting C binded code, and looking for a way to abstract as much as possible the shuttle scheduler trait and such...

Thanks !

53
15
submitted 8 months ago by IngrownMink4@lemmy.ml to c/rust@lemmy.ml

publicado de forma cruzada desde: https://infosec.pub/post/8054415

Stract is an open source search engine where the user has the ability to see exactly what is going on and customize almost everything about their search results. It's a search engine made for hackers and tinkerers just like ourselves. No more searches where some of the terms in the query arent used, and the engine tries to guess what you really meant. You get what you search for.

Fun fact: It's written in Rust! (nearly 90%) https://github.com/StractOrg/stract

54
54
submitted 8 months ago by maegul@lemmy.ml to c/rust@lemmy.ml

Hi all,

We've started a new community for learning rust and/or the lemmy codebase together.

Come join in: !learningrustandlemmy@lemmy.ml

The idea is that there are probably a good amount of people interested in learning rust, or, interested in contributing to or using the lemmy codebase, but find it difficult to get started ... so basically why not start a sort of study group or reading group or support channel style of community? Here's where the idea was originally suggested: https://lemmy.ml/post/11232276

We're just putting the place together and sorting out how it could work, but all kinds of inputs and levels of expertise are welcome!

55
12
submitted 8 months ago by Grappling7155@lemmy.ca to c/rust@lemmy.ml
56
27
submitted 8 months ago by ylai@lemmy.ml to c/rust@lemmy.ml
57
58
submitted 8 months ago* (last edited 8 months ago) by hohenheim@lemmy.world to c/rust@lemmy.ml

I am delighted to finally release a project that has been cooking for quite a while: Yarn Spinner for Rust 🎉 . Some of you might remember this under the name Yarn Slinger, but the kind folks at Secret Lab have allowed me to use their trademark! Yay!

What is Yarn Spinner?

It's a friendly tool that helps you write dialog! See for yourself at the live demo. You can also check out this or this GDC talk about the original C# implementation. What I have released today is the Rust port for the project, with first-class support for Bevy!

Quickstart

Writing a dialog with Yarn Spinner is as easy as whipping up a simple screenplay:

// assets/dialogue/hello_world.yarn
title: Start
***
Ancient Reptilian Brain: There is nothing. Only warm, primordial blackness. Your conscience ferments in it -- no larger than a single grain of malt. You don't have to do anything anymore.
Ancient Reptilian Brain: Ever.
Ancient Reptilian Brain: Never ever.
-> Never ever ever?
  Ancient Reptilian Brain: Never ever ever ever, baby!
-> (Simply keep on non-existing.)

Ancient Reptilian Brain: An inordinate amount of time passes. It is utterly void of struggle. No ex-wives are contained within it. 
===

Pretty simple file format, right? Check out the general Yarn Spinner documentation for more or look into the Bevy examples.

58
44
submitted 8 months ago by tracyspcy@lemmy.ml to c/rust@lemmy.ml

I made it for myself as the simplest way to keep track of positive routines. The concept is simple: Track the activities that make up your perfect day and monitor your daily progress effortlessly. Here is also a github link for those who interested : https://github.com/tracyspacy/yacht

59
2
submitted 8 months ago by ta1da@mastodon.social to c/rust@lemmy.ml

Maybe 2024 will be the year I rebuild everything in @rust

60
32
submitted 8 months ago by thevoidzero@lemmy.world to c/rust@lemmy.ml

cross-posted from: https://lemmy.world/post/11271385

Basically, you can choose some slides from an opened .tex file to copy. It also has the function to see which graphics files are included in the selected files, so you know which ones to copy.

Here is the Github link: https://github.com/Atreyagaurav/beamer-quickie

The PDF pages are shown using the SyncTeX (if available) so that you can visually choose the slides as long as there is a single .tex source file, (might still work without synctex for simple cases).

I've made it on Linux, so it hasn't been tested in windows. You probably will need to compile gtk on Windows if you want to make it work. So if someone is really interested let me know, I can give instructions. Even in linux you'll need to install dependencies.

61
41
submitted 9 months ago by solarzones@programming.dev to c/rust@lemmy.ml

I am new to Rust, and have always been interested in how games were made. But man I've got to say that just ready the bevy book has been pretty fun. I am looking at all the examples in the repo. I wanna here others perspective on bevy, or Rust game development in general!

crossposted from: https://programming.dev/post/8881051

62
26
submitted 9 months ago by tracyspcy@lemmy.ml to c/rust@lemmy.ml
63
24
64
3
submitted 9 months ago* (last edited 9 months ago) by ozoned@lemmy.world to c/rust@lemmy.ml

cross-posted from: https://lemmy.world/post/10459323

Live coding Matrix in Rust #owncast #streaming #coding #rust #matrix

Find Andy’s previous recordings at: https://diode.zone/a/andybalaam/video-channels

65
62
submitted 9 months ago by nutomic@lemmy.ml to c/rust@lemmy.ml

This library is responsible for federation in Lemmy, and can also be used by other Rust projects.

66
39
submitted 10 months ago by Sibbo@sopuli.xyz to c/rust@lemmy.ml
67
28
submitted 10 months ago by Sibbo@sopuli.xyz to c/rust@lemmy.ml
68
9
submitted 10 months ago* (last edited 10 months ago) by marsuplane@lemmy.world to c/rust@lemmy.ml

Hi! Mles (Modern Lightweight channEl Service) protocol with Rust-based reference implementation is on the path to upgrade to v2. The new version will be simpler and more secure. In case interested how to make the protocol v2 draft even better, please join discussion and comment on !mles@lemmy.world. Thanks!

69
7

I've seen a few but I can't decide which protocol to use yet. I'm working on a DHT pet project and I'd like to avoid making it rely on any relay servers.

Thanks in advance for any pointers!

70
7
submitted 10 months ago* (last edited 10 months ago) by pr06lefs@lemmy.ml to c/rust@lemmy.ml

Ed: solved with the help of the async_stream crate.

I'm struggling with the borrow checker!

My problem: I'm using actix-web and rusqlite. I want to return an unlimited number of records from an rusqlite query, and actix provides a Stream trait for that kind of thing. You just impl the trait and return your records from a poll_next() fn.

On the rusqlite side, there's this query_map that returns an iterator of records from a query. All I have to do is smush these two features together.

So the plan is to put the iterator returned by query_map into a struct that impls Stream. Problem is the lifetime of a var used by query_map. How to make the var have the same lifetime as the iterator??

So here's the code:

pub struct ZkNoteStream<'a, T> {
  rec_iter: Box<dyn Iterator<Item = T> + 'a>,
}

// impl of Stream just calls next() on the iterator.  This compiles fine.
impl<'a> Stream for ZkNoteStream<'a, serde_json::Value> {
  type Item = serde_json::Value;

  fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
    Poll::Ready(self.rec_iter.next())
  }
}

// init function to set up the ZkNoteStream.
impl<'a> ZkNoteStream<'a, Result<ZkListNote, rusqlite::Error>> {
  pub fn init(
    conn: &'a Connection,
    user: i64,
    search: &ZkNoteSearch,
  ) -> Result<Self, Box<dyn Error>> {
    let (sql, args) = build_sql(&conn, user, search.clone())?;

    let sysid = user_id(&conn, "system")?;
    let mut pstmt = conn.prepare(sql.as_str())?;

    // Here's the problem!  Borrowing pstmt.
    let rec_iter = pstmt.query_map(rusqlite::params_from_iter(args.iter()), move |row| {
      let id = row.get(0)?;
      let sysids = get_sysids(&conn, sysid, id)?;
      Ok(ZkListNote {
        id: id,
        title: row.get(1)?,
        is_file: {
          let wat: Option<i64> = row.get(2)?;
          wat.is_some()
        },
        user: row.get(3)?,
        createdate: row.get(4)?,
        changeddate: row.get(5)?,
        sysids: sysids,
      })
    })?;

    Ok(ZkNoteStream::<Result<ZkListNote, rusqlite::Error>> {
      rec_iter: Box::new(rec_iter),
    })
  }
}

And here's the error:

error[E0515]: cannot return value referencing local variable `pstmt`
   --> server-lib/src/search.rs:170:5
    |
153 |       let rec_iter = pstmt.query_map(rusqlite::params_from_iter(args.iter()), move |row| {
    |                      ----- `pstmt` is borrowed here
...
170 | /     Ok(ZkNoteStream::<Result<ZkListNote, rusqlite::Error>> {
171 | |       rec_iter: Box::new(rec_iter),
172 | |     })
    | |______^ returns a value referencing data owned by the current function

So basically it boils down to pstmt getting borrowed in the query_map call. It needs to have the same lifetime as the closure. How do I ensure that?

71
23
submitted 10 months ago* (last edited 10 months ago) by jack@monero.town to c/rust@lemmy.ml

UPDATE: I found this issue explaining the relicensing of rust game engine Bevy to MIT + Apache 2.0 dual. Tldr: A lot of rust projects are MIT/Apache 2.0 so using those licenses is good for interoperability and upstreaming. MIT is known and trusted and had great success in projects like Godot.

ORIGINAL POST:

RedoxOS, uutils, zoxide, eza, ripgrep, fd, iced, orbtk,...

It really stands out considering that in FOSS software the GPL or at least the LGPL for toolkits is the most popular license

Most of the programs I listed are replacements for stuff we have in the Linux ecosystem, which are all licensed under the (L)GPL:

uutils, zoxide, eza, ripgrep, fd -> GNU coreutils (GPL)

iced, orbtk -> GTK, QT (LGPL)

RedoxOS -> Linux kernel, most desktop environments like GNOME, KDE etc. all licensed GPL as much as possible

72
9
submitted 10 months ago* (last edited 10 months ago) by force@lemmy.world to c/rust@lemmy.ml

I find that a lot of libraries tend to be Linux-focused and generally kind of ugly on Windows, so what do you use when you want to make something that looks nice and performs well on Windows?

The best looking ones I've seen were web frontends like in Tauri. A runner up would maybe be iced-rs. Which is a shame because I really wanted to use relm or fltk-rs but it looks like I'd almost have to use the web renderer to get "sleek, sexy" GUIs...

73
15
submitted 10 months ago by dindresto@lemmy.korz.dev to c/rust@lemmy.ml

We are starting a new meetup group for the Rhein-Neckar-Region in Heidelberg, Germany.

The first event will take place on December 19 at the University's Mathematikon.

The twist is that we're beginning with a dual-topic meetup: Nix & Rust.

As there is some overlap between the two communities and we couldn't decide for which of the two we'd rather organize a meetup, we went for both in one.

The meetup is organized through the regional Mobilizon instance: https://rheinneckar.events/events/298e520c-89ca-4754-96f8-e252b96b7a46

Please sign up if you plan on attending so we can make sure there is enough space for all participants. Also feel free to drop an email at nixrust@rheinneckar.events or a Mastodon message at https://rheinneckar.social/@NixRust if you would like to become a speaker for the meetup, be it with a NixOS or Rust topic, or a combination of both!

The current (tentative) schedule:

  • 18:30 - Open Doors

  • 19:00 - Greeting

  • 19:05 - An Introduction to Nix

  • 19:30 - Second Talk (Rust related)

  • 20:00 - Networking and get together

74
21
submitted 10 months ago by jplatte@discuss.tchncs.de to c/rust@lemmy.ml
75
27
Axum 0.7 released (github.com)
submitted 10 months ago by milliams@lemmy.world to c/rust@lemmy.ml

This is the new release of Axum, the first to use the also newly-released hyper 1.0.

view more: ‹ prev next ›

Rust Programming

8093 readers
1 users here now

founded 5 years ago
MODERATORS