v0.3.0
Pre-release
Pre-release
Changes
Library
- Completely overhauled the API by decoupling the request methods from the response structs
- Add functionality to get the raw JSON response
- Code restructuring and refactoring
- Add more testing
- Add iterators to
Factor
- Improved documentation
CLI app
- Add raw JSON output
- Accept multiple inputs on CLI app
- Make CLI-only dependencies optional behind the
cli
cargo feature
Breaking changes
Please note that this version has a lot of breaking changes. Some things to consider:
Number::get
andNumber::get_blocking
has been replaced byFactorDbClient::get
andFactorDbBlockingClient::get
respectively. Note that the clients must be instantiated first before it's ready to use.
Example code migration:
v0.2.0
use factordb::Number;
let even_num = Number::get(42).await?;
v0.3.0
use factordb::FactorDbClient;
use num_bigint::BigInt; // All numeric values in the result object are of this type
// Initialise the client
let client = FactorDbClient::new();
// Make requests
let forty_two = client.get(42).await?;
let expect_factors: Vec<BigInt> = vec![2, 3, 7].into_iter().map(|n| BigInt::from(n)).collect();
assert_eq!(forty_two.into_factors_flattened(), expect_factors);
- The output format of the commanline app has changed. It now repeats the factor unless
--unique
is passed, e.g.42
returns2 3 7
- CLI app is now locked behind
cli
feature.