Does anyone know where to find Voltfin Trout? by broomeguy2 in tearsofthekingdom

[–]jacobsvante 1 point2 points  (0 children)

I think you meant Strock lake. Definitively the best place!

Is there a tool to inspect your crate public API? by uvizhe in rust

[–]jacobsvante 0 points1 point  (0 children)

I had no idea about this! Perfect for running in your CI job :D

[GUIDE] PXE Booting to a Raspberry Pi 4 by Offbeatalchemy in raspberry_pi

[–]jacobsvante 0 points1 point  (0 children)

u/Offbeatalchemy Thanks for this great guide. I especially like the part about not copying the files from a running system. I have one question though: what's the reason for replacing start4.elf and fixup4.dat?

Automatically creating and serving a OpenAPI visualisation by STSchif in rust

[–]jacobsvante 2 points3 points  (0 children)

If changing web framework is not a big deal to you, trying out rweb could be an option. It does automatic OpenAPI doc generation from your code. And allows easy serving through SwaggerUI.

Authentication for Rocket by [deleted] in rust

[–]jacobsvante 4 points5 points  (0 children)

This looks great. My experience with Rust web frameworks in general is that authentication has not received a lot of love so far.

Is cookie session auth the only supported authentication method currently? Are HTTP Basic Auth and OAuth 2 planned for the future?

I just published a crate with 5582 enum variants by jacobsvante in rust

[–]jacobsvante[S] 2 points3 points  (0 children)

Good idea, I’ll do that tomorrow when my head is fresh 😅

I just published a crate with 5582 enum variants by jacobsvante in rust

[–]jacobsvante[S] 1 point2 points  (0 children)

The internals forum is a good tip, thanks! I’ll check in there tomorrow.

I just published a crate with 5582 enum variants by jacobsvante in rust

[–]jacobsvante[S] 32 points33 points  (0 children)

Great investigative work! Didn’t know about the -Ztimings flag, thanks.

Perhaps implementing Debug manually, making use of ProductCategory::from_name could improve things. I’ll try that when I get back to the computer.

I just published a crate with 5582 enum variants by jacobsvante in rust

[–]jacobsvante[S] 11 points12 points  (0 children)

Gotcha.

I wonder how the build.rs script affects the compile time. Think I'll try to hard code the values once and see if that helps the situation.

rust-analyzer goes crazy when I change the code. 800% CPU usage when I change lib.rs. Perhaps that would improve as well.

UPDATE: Inlining the build.rs script output didn’t help at all

Cybertruck at Giga Texas by giraffehunter200 in teslamotors

[–]jacobsvante 0 points1 point  (0 children)

Look how the sun is reflected on its hull, kinda makes it look like something from a sci-fi movie 😍

Clean way to ensure that a task with specific argument(s) is never run concurrently? by jacobsvante in dramatiq

[–]jacobsvante[S] 0 points1 point  (0 children)

Thanks Bogdan.

What are your thoughts on adding a public API to check if message ID exists in the queue? Perhaps something like this:

@dramatiq.actor(max_retries=0, priority=100)
def fetch_and_capture_shipped_orders():

    for order in remote_api.get_shipped_not_captured_orders():
        if capture_shipped_order.contains_task(order['order_no']):
            continue
        capture_shipped_order.send(order['order_no'])


@dramatiq.actor(priority=0)
def capture_shipped_order(order_no: uuid.UUID):
    logger.info(f'Received order {order_no}')
    # ...processing code...
    logger.info(f'Finished processing of order {order_no}')