Repository navigation
v0.7.0
Pre-release
Pre-release
Changes
Library
- Completely overhauled the API by decoupling the request methods from the response structs
- Add
is_oddtop level function andisodd()method inIsEvenApiResponse(formerlyIsEven) - Improved error handling by separating error types thrown by the API
- Improved names for structs etc
- Updated dependencies
- Other internal code & test refactoring
- Add derive traits to
IsEvenApiResponseandIsEvenApiErrorResponse - Add crate feature
blockingfor blocking code
CLI app
- Add raw JSON output
- Accept multiple inputs on CLI app
- Make CLI-only dependencies optional behind the
clicargo feature
Breaking changes
Please note that this version has a lot of breaking changes. Some things to consider:
IsEven::getandIsEven::get_blockinghas been replaced byIsEvenApiClient::getandIsEvenApiBlockingClient::getrespectively. Note that the clients must be instantiated first before it's ready to use.
Example code migration:
v0.6.0
use iseven_api::IsEven;
let even_num = IsEven::get(42).await?;v0.7.0
use iseven_api::IsEvenApiClient;
// Initialise the client
let client = IsEvenApiClient::new();
// Make requests
let even_num = client.get(42).await?;- Struct and enum names have changed:
IsEven->IsEvenApiResponseErrorResponse->IsEvenApiErrorResponseIsEvenError->IsEvenApiError
- The enum variant
IsEvenError::ErrorResponsehas been split into 3 inIsEvenApiError:NumberOutOfRangeInvalidNumberUnknownErrorResponse- for errors that don't fit in the above categories
- All blocking functionalities are now locked behind
blockingfeature. To enable them, pass--features blockingor--all-featuresto cargo - CLI app is now locked behind
clifeature.