bobertoyin / mbta-rs Goto Github PK
View Code? Open in Web Editor NEWA Rust client to interact with the MBTA V3 API.
Home Page: https://crates.io/crates/mbta-rs
License: MIT License
A Rust client to interact with the MBTA V3 API.
Home Page: https://crates.io/crates/mbta-rs
License: MIT License
Is your feature request related to a problem? Please describe.
There's not much of a reason to consume the plottable data when only references to the data fields are necessary.
Describe the solution you'd like
Change function signature from fn plot(self...
to fn plot(&self...
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
The Client
struct doesn't mutate itself, so it should be handy enough to add these traits to the client in order to make it work better with multi-threaded use-cases.
Describe the solution you'd like
Derive/implement the above traits for the struct.
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
Query parameters for endpoints are currently expected to be of HashMap<String, String>
: this type is generally too inconvenient and restrictive and could be loosened to be easier to use.
Describe the solution you'd like
Internally, each endpoint function iterates over each key-value pair and only uses the &str
values: this means that we could have some generic parameter that implements IntoIterator<Item = (AsRef<Str>, AsRef<Str>)>
(this is obviously not what it'll look like in Rust, but it captures the essence of what the generic should look like).
Describe alternatives you've considered
N/A
Additional context
N/A
Is your feature request related to a problem? Please describe.
The MBTA V3 API contains a lot of latitudinal and longitudinal data: it'd be cool to provide some simple, optional functionality to plot this data!
Describe the solution you'd like
Leveraging the staticmap
crate seems to be the simplest solution: it's a no-frills library that can render the simplest elements necessary (lines, circles, icons) without being too hefty of an addition.
Describe alternatives you've considered
There are plenty of crates related to OpenStreetMap and Google Maps, but none of them are quite as "batteries-included" a.k.a "no-implementation-required" as staticmap
.
Is your feature request related to a problem? Please describe.
Currently, invalid request errors are boxed into a high-level client error; this isn't particularly helpful in diagnosing what specific issues the MBTA API had with the request (typically invalid query parameters or non-existent resources).
Describe the solution you'd like
ureq
errors have a Status
error that contains a status code and a response object with a known schema. This means that a helpful "error" response could be returned that indicates to the user what issues the API had with the request. Refactoring would convert the existing Response
struct into an enum with some kind of Success
variant and Error
variant, with the Success
variant containing the current Response
schema and the Error
variant containing the error response schema.
Describe alternatives you've considered
N/A
Additional context
N/A
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.