Skip to content

Releases: megascrapper/factordb-rust

v0.3.0

05 Feb 02:55
51e4ae9
Compare
Choose a tag to compare
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 and Number::get_blocking has been replaced by FactorDbClient::get and FactorDbBlockingClient::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 returns 2 3 7
  • CLI app is now locked behind cli feature.

v0.2.0

28 Jan 23:57
v0.2.0
61fbcff
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release
  • Make blocking functions available under a cargo feature.

Breaking changes

  • All blocking functionalities are now locked behind blocking feature. To enable them, pass --features blocking or --all-features to cargo

v0.1.0

28 Jan 23:55
v0.1.0
a307ff2
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release
  • Initial release