851
14

beginner question: What is the advantage of using cmp::Ordering::Less over "<", same for Greater and Equals?

852
15
853
26
854
18
855
14
856
18
857
46
submitted 2 years ago by nutomic@lemmy.ml to c/rust@programming.dev

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

858
20

Version 5.1.0 of Kellnr, the private crate registry for Rust was just released. It features a new landing page, dependency updates and bug fixes.

Check it out, if you want to host crates on your own hardware!

859
33
860
11
861
39

who?

Hello! I'm Víctor (aka Brian3647), a 15-year- old self-taught spanish developer. I love rust & cats, and I hate JS. I've been working on this project for ~2.5 months now:

what?

Snowboard (https://github.com/Brian3647/snowboard) is a library written in rust made for creating http/https servers easily. It supports json*, websockets*, TLS*, async*, http request parsing & response generation. *: enabled by feature

why?

Some developers like me prefer a simple API that can be freely extended for your app over a big system of complex proc macros where you have no idea what or how is happening. Snowboard offers a simplistic API that gives freedom of use to the developer without any complication or headache. You code your server just like you want it to be.

should I use snowboard?

Give it a try! From what I've seen, some people like a lot this way of coding servers, whereas other people can't live without #[get("/")]. Use it or not, giving a star to the project is always appreciated :)

example program (as of 1.0.3):

use snowboard::{headers, response, Method, Result, Server};

fn main() -> Result {
    let server = Server::new("localhost:8080")?;

    println!("Listening on {}", server.pretty_addr()?);

    server.run(|req| {
        if req.method == Method::DELETE {
            return response!(method_not_allowed, "Caught you trying to delete!");
        }

        response!(ok, "Hello!", headers! { "X-Hello" => "World!" })
    })
}
862
112
Announcing Rust 1.75.0 (blog.rust-lang.org)

Traits now support async fn and -> impl Trait (with some limitations), the compiler got faster, version = in Cargo​.toml is now optional, and many small functions have been stabilized!

863
12
submitted 2 years ago* (last edited 2 years ago) by rglullis@communick.news to c/rust@programming.dev

One of my new years' resolutions is to be able to be productive enough with Rust to start making contributions to Lemmy and/or to integrate part of the Fediverser project (specifically, the "login with Reddit" feature) into it.

But first steps first, and I want to make a simple web app where I can authenticate users against an LDAP database, and show some data only for authenticated users.

It seems that the most mature libraries for web development in Rust is still actix web (and also the one that Lemmy uses), but what about other parts? Is Tera a good option for someone who is already familiar with Jinja (and Django)? Most of the tutorials I found out are for using actix web mostly as a json API and leaves the frontend for specific javascript SPAs, but what if I want to do "old school" web pages?

864
15

Hi folks, this is a little article I wrote as a blueprint for building a structured concurrency API, which I aim to build with safe Rust in the future. I'm aware of thread scopes but do not know of something that provides composable and structured async. I wanted to have a strong foundation before implementing this. Please feel free to suggest ideas!

865
12
Rust Analyzer Changelog #213 (rust-analyzer.github.io)
866
39
867
24
868
30
869
19
870
39
submitted 2 years ago by clot27@lemm.ee to c/rust@programming.dev
871
23
872
9
873
5
874
45
Rust is growing (flawless.dev)
875
13
Rust Analyzer Changelog #212 (rust-analyzer.github.io)
view more: ‹ prev next ›

Rust

8252 readers
30 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 3 years ago
MODERATORS