rocket-api | A REST API build with the rocket.rs framework | REST library
kandi X-RAY | rocket-api Summary
kandi X-RAY | rocket-api Summary
A REST API build with the rocket.rs framework
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of rocket-api
rocket-api Key Features
rocket-api Examples and Code Snippets
Community Discussions
Trending Discussions on rocket-api
QUESTION
So I was trying to follow the example from https://medium.com/sean3z/building-a-restful-crud-api-with-rust-1867308352d8 to build a simple REST API. Half way through, the rust compiler gives me the the following error:
unresolved imports 'rocket_contrib::Json', 'rocket_contrib::Value' no 'Json' in the root
I can't seem to figure out what I am doing wrong.
Here is my Cargo.toml:
...ANSWER
Answered 2020-Apr-09 at 07:59The example code was written for the now obsolete version 0.3.x of Rocket. You can't start new projects based on the old version anymore, since some of the dependencies have been yanked from crates.io. However, it's relatively easy to fix the example code – the import the compiler is complaining about isn't used anyway, so you can simply remove it. In version 0.4.x of rocket_contrib
the rocket_contrib::Json
struct has been moved to rocket_contrib::json::Json
, so you can also import from the new location if you need it. The rocket_contrib::Value
enum has been replaced with rocket_contrib::json::JsonValue
, albeit with a different implementation, so you may need to adapt any uses to the new interface.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install rocket-api
Rust is installed and managed by the rustup tool. Rust has a 6-week rapid release process and supports a great number of platforms, so there are many builds of Rust available at any time. Please refer rust-lang.org for more information.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page