I’m brand new to Rust. I’m giving it a try as a result of the Instapaper API implementation. My application is working based on the examples provided there, but the output appears to be a Rust List object, rather than the JSON string that Instapaper normally returns. How do I get the List object output as JSON?
I’ve tried json::stringify as well as to_string() and serde_json but I don’t really understand the fundamentals well enough to get it to work.
Here’s an example API call from the examples provided with the crate:
I understand that bookmarks() returns a list, but I don’t know how to cause it to be output as JSON so it can be manipulated with standard tools like JQ.
It can't be done in this case, since the type in question is instapaper::List, not some local type. And it actually doesn't implement Serialize, since... I guess for crate authors this just doesn't make much sense? Like, if you've already got structured, strong-typed data, you can do any processing on that data (all its fields are public anyway), not converting it back to JSON?