Rust

5989 readers
63 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 1 year ago
MODERATORS
351
352
353
354
 
 

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

355
 
 

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!

356
357
358
 
 

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!" })
    })
}
359
 
 

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!

360
 
 

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?

361
 
 

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!

362
363
364
365
366
367
368
369
370
371
372
373
374
375
view more: ‹ prev next ›