2023-02-08
2588
#rust
Bastian Gruber
17568
Feb 8, 2023 â‹… 9 min read

Building a REST API in Rust with warp

Bastian Gruber I'm a passionate software developer who mainly works with Rust to create services for the web. Next to that, I write for several tech magazines and publish articles on my own. Every now and then I get interviewed as well.

Recent posts:

Rxjs Adoption Guide: Overview, Examples, And Alternatives

RxJS adoption guide: Overview, examples, and alternatives

Get to know RxJS features, benefits, and more to help you understand what it is, how it works, and why you should use it.

Emmanuel Odioko
Jul 26, 2024 â‹… 13 min read
Decoupling Monoliths Into Microservices With Feature Flags

Decoupling monoliths into microservices with feature flags

Explore how to effectively break down a monolithic application into microservices using feature flags and Flagsmith.

Kayode Adeniyi
Jul 25, 2024 â‹… 10 min read
Lots of multi-colored blue and purplish rectangles.

Animating dialog and popover elements with CSS @starting-style

Native dialog and popover elements have their own well-defined roles in modern-day frontend web development. Dialog elements are known to […]

Rahul Chhodde
Jul 24, 2024 â‹… 10 min read
Using Llama Index To Add Personal Data To Large Language Models

Using LlamaIndex to add personal data to LLMs

LlamaIndex provides tools for ingesting, processing, and implementing complex query workflows that combine data access with LLM prompting.

Ukeje Goodness
Jul 23, 2024 â‹… 5 min read
View all posts

5 Replies to "Building a REST API in Rust with warp"

  1. Thanks, I was stuck but your tutorial helped me. I’m noob to rust so I would love more tutorials 🙂

  2. Thanks for the tut. One remark though:
    “Due to the nature of Rust’s ownership model, you can’t simply read and return the underlying list of groceries.”
    That’s not true, the Deref trait on Mutex allows us to do this:

    Ok(warp::reply::json(&*store.grocery_list.read()));

    Cheers 🙂

  3. Thanks for the tutorial.

    Maybe I am missing something, but it seems to me, your curl delete example is missing the id. In fact I am missing where the id path section is defined at all for get (on a single item) and put.

  4. sorry noob here, how can I solve this ?:

    error: cannot find derive macro `Deserialize` in this scope
    –> src/serve.rs:69:17
    |
    69 | #[derive(Debug, Deserialize, Serialize, Clone)]
    | ^^^^^^^^^^^

    Thanks a lot !

Leave a Reply