kylesurowiec / swapi-rust Goto Github PK
View Code? Open in Web Editor NEWAn API wrapper for https://swapi.co built with Rust
License: MIT License
An API wrapper for https://swapi.co built with Rust
License: MIT License
Card for implementing the Starships portion of swapi.
Attributes:
name string -- The name of this starship. The common name, such as "Death Star".
model string -- The model or official name of this starship. Such as "T-65 X-wing" or "DS-1 Orbital Battle Station".
starship_class string -- The class of this starship, such as "Starfighter" or "Deep Space Mobile Battlestation"
manufacturer string -- The manufacturer of this starship. Comma separated if more than one.
cost_in_credits string -- The cost of this starship new, in galactic credits.
length string -- The length of this starship in meters.
crew string -- The number of personnel needed to run or pilot this starship.
passengers string -- The number of non-essential people this starship can transport.
max_atmosphering_speed string -- The maximum speed of this starship in the atmosphere. "N/A" if this starship is incapable of atmospheric flight.
hyperdrive_rating string -- The class of this starships hyperdrive.
MGLT string -- The Maximum number of Megalights this starship can travel in a standard hour. A "Megalight" is a standard unit of distance and has never been defined before within the Star Wars universe. This figure is only really useful for measuring the difference in speed of starships. We can assume it is similar to AU, the distance between our Sun (Sol) and Earth.
cargo_capacity string -- The maximum number of kilograms that this starship can transport.
consumables *string
The maximum length of time that this starship can provide consumables for its entire crew without having to resupply.
films array -- An array of Film URL Resources that this starship has appeared in.
pilots array -- An array of People URL Resources that this starship has been piloted by.
url string -- the hypermedia URL of this resource.
created string -- the ISO 8601 date format of the time that this resource was created.
edited string -- the ISO 8601 date format of the time that this resource was edited.
Search Fields:
name
model
Currently the src/lib.rs
file is empty, and that file should contain the library logic. The types can stay separated, but the querying should be moved to a src/lib.rs
This change is pretty important for tests, as the methods will be able to be accessed easily.
Card for implementing the People portion of swapi.
Attributes:
name string -- The name of this person.
birth_year string -- The birth year of the person, using the in-universe standard of BBY or ABY - Before the Battle of Yavin or After the Battle of Yavin. The Battle of Yavin is a battle that occurs at the end of Star Wars episode IV: A New Hope.
eye_color string -- The eye color of this person. Will be "unknown" if not known or "n/a" if the person does not have an eye.
gender string -- The gender of this person. Either "Male", "Female" or "unknown", "n/a" if the person does not have a gender.
hair_color string -- The hair color of this person. Will be "unknown" if not known or "n/a" if the person does not have hair.
height string -- The height of the person in centimeters.
mass string -- The mass of the person in kilograms.
skin_color string -- The skin color of this person.
homeworld string -- The URL of a planet resource, a planet that this person was born on or inhabits.
films array -- An array of film resource URLs that this person has been in.
species array -- An array of species resource URLs that this person belongs to.
starships array -- An array of starship resource URLs that this person has piloted.
vehicles array -- An array of vehicle resource URLs that this person has piloted.
url string -- the hypermedia URL of this resource.
created string -- the ISO 8601 date format of the time that this resource was created.
edited string -- the ISO 8601 date format of the time that this resource was edited.
Search Fields:
name
pub fn api_query<T>(endpoint: &str) -> HashMap<String, T>
https://swapi.co/api/species/2/
returns null
for field homeworld
instead of expected String
.
Card for implementing the Species portion of swapi.
Attributes:
name string -- The name of this species.
classification string -- The classification of this species, such as "mammal" or "reptile".
designation string -- The designation of this species, such as "sentient".
average_height string -- The average height of this species in centimeters.
average_lifespan string -- The average lifespan of this species in years.
eye_colors string -- A comma-separated string of common eye colors for this species, "none" if this species does not typically have eyes.
hair_colors string -- A comma-separated string of common hair colors for this species, "none" if this species does not typically have hair.
skin_colors string -- A comma-separated string of common skin colors for this species, "none" if this species does not typically have skin.
language string -- The language commonly spoken by this species.
homeworld string -- The URL of a planet resource, a planet that this species originates from.
people array -- An array of People URL Resources that are a part of this species.
films array -- An array of Film URL Resources that this species has appeared in.
url string -- the hypermedia URL of this resource.
created string -- the ISO 8601 date format of the time that this resource was created.
edited string -- the ISO 8601 date format of the time that this resource was edited.
Search Fields:
name
Integration tests for API usage.
Include possible common uses in tests, as well as negative tests
Card for implementing the Vehicles portion of swapi.
Attributes:
name string -- The name of this vehicle. The common name, such as "Sand Crawler" or "Speeder bike".
model string -- The model or official name of this vehicle. Such as "All-Terrain Attack Transport".
vehicle_class string -- The class of this vehicle, such as "Wheeled" or "Repulsorcraft".
manufacturer string -- The manufacturer of this vehicle. Comma separated if more than one.
length string -- The length of this vehicle in meters.
cost_in_credits string -- The cost of this vehicle new, in Galactic Credits.
crew string -- The number of personnel needed to run or pilot this vehicle.
passengers string -- The number of non-essential people this vehicle can transport.
max_atmosphering_speed string -- The maximum speed of this vehicle in the atmosphere.
cargo_capacity string -- The maximum number of kilograms that this vehicle can transport.
consumables *string
The maximum length of time that this vehicle can provide consumables for its entire crew without having to resupply.
films array -- An array of Film URL Resources that this vehicle has appeared in.
pilots array -- An array of People URL Resources that this vehicle has been piloted by.
url string -- the hypermedia URL of this resource.
created string -- the ISO 8601 date format of the time that this resource was created.
edited string -- the ISO 8601 date format of the time that this resource was edited.
Search Fields:
name
Card for implementing the Films portion of swapi.
Attributes:
title string -- The title of this film
episode_id integer -- The episode number of this film.
opening_crawl string -- The opening paragraphs at the beginning of this film.
director string -- The name of the director of this film.
producer string -- The name(s) of the producer(s) of this film. Comma separated.
release_date date -- The ISO 8601 date format of film release at original creator country.
species array -- An array of species resource URLs that are in this film.
starships array -- An array of starship resource URLs that are in this film.
vehicles array -- An array of vehicle resource URLs that are in this film.
characters array -- An array of people resource URLs that are in this film.
planets array -- An array of planet resource URLs that are in this film.
url string -- the hypermedia URL of this resource.
created string -- the ISO 8601 date format of the time that this resource was created.
edited string -- the ISO 8601 date format of the time that this resource was edited.
Search Fields:
title
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.