ripread

u/ripread


r/rust•

I'm looking at the actix-multipart example and there's a lot of blocking file IO. Is it possible to send a response before downloading the file? Multipart isn't Send. I want to do something like this:

async fn save_file(mut payload: Multipart) -> Result<HttpResponse, Error> {
    async_std::task::spawn(async {
        // iterate over multipart stream
        while let Some(item) = payload.next().await {
            let mut field = item?;
            let content_type = field.content_disposition().unwrap();
            let filename = content_type.get_
31

r/webdev•

Hi Webdev,

I'm poor but I really want to know how many hits I'm getting on my website. My current plan is to send myself an email every time someone visits each webpage, then I can use email filters to give myself some concrete numbers.

How do I send myself an email through front-end javascript? I know I have to create a login session somehow but the deeper I get into the OAuth docs the more confused I get.

08


r/rust•

Hey all,

What are some of the ugliest things you've seen done with Rusts Generics system?

I remember there were a bunch of posts back before HKTs and HOFs. Do ya'll have any saved?

54

r/LaTeX•

I've got a titleformat that left-aligns the title: `\titleformat{\section}{ \raggedright }`. This is good. I want most of my section titles to be left-aligned. I want two of them to be centered. How do I special case these two?

I'm already using subsection, paragraph, etc throughout the document. Is there a way to create a custom keyword? Something like `\titleformat{\c-section}{ \centering }`?

21



r/rust•

Hey Rustaceans. I've been messing around with wasm the past couple days. I've done the Conway book example and am working on a tetris game right now. I just don't like using wasm-pack.

Here's what I'm trying to do. Basically I found the MDN documentation for `fetch` and I'm trying to use that. I've written the whole game in Rust with only a single point of entry from the javascript to the wasm. The problem is web-sys. web-sys imports javascript functions so my `instantiateStreaming` call needs an importObject. Is there a way to auto-generate just the giant importObjec

32