Skip to content

0.3.0-alpha-1

Latest
Compare
Choose a tag to compare
@ClementTsang ClementTsang released this 09 Nov 03:47
· 14 commits to master since this release

With async finally here, I've ticked the version up by one. Note the alpha tag, this is due to the fact that reqwest does not seem to have file functionality built yet for async, and as such, file searching with this wrapper does not work for that. So for now, file searching with async will throw an error, and you should rely on the original (blocking) get_sauce function for that situation. Upon that blocker being fixed, I'll push an update.

Changes

  • As mentioned, async options are now here! To see what it might look like, see this example, but the gist is:
#[tokio::main]
async fn main() -> Result<(), Error> {
	let result = handle.async_get_sauce_as_pretty_json("https://i.imgur.com/W42kkKS.jpg", None, None);
}
  • HandlerBuilder::new() is no longer a thing; use HandlerBuilder::default() and build from there. It should therefore look like:
let handle = HandlerBuilder::default()
			.api_key(key)
			.num_results(999)
			.db_mask([Handler::PIXIV, Handler::SANKAKU_CHANNEL].to_vec())
			.build();
  • Both the testmode and num_results fields in the Handler are now of type Option<u32>, rather than Option<i32>.

  • Some optimizations here and there in terms of code structure/reuse.

  • Some changes due to the updating of dependencies.