From 72d158513c01b9055a857cd94a756deb0cb32d28 Mon Sep 17 00:00:00 2001 From: baummarten Date: Thu, 12 Jan 2023 17:01:33 +0100 Subject: [PATCH] Registration::new_with_client Registration can now be created with a custom Reqwest Client. --- src/registration.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/registration.rs b/src/registration.rs index 129ca6d..f8ddc82 100644 --- a/src/registration.rs +++ b/src/registration.rs @@ -57,6 +57,22 @@ impl<'a> Registration<'a> { force_login: false, } } + + /// Construct a new registration process to the instance of the `base` url, + /// using the provided [Client]. + /// ``` + /// use mastodon_async::prelude::*; + /// + /// let registration = Registration::new("https://botsin.space"); + /// ``` + pub fn new_with_client>(base: I, client: Client) -> Self { + Registration { + base: base.into(), + client, + app_builder: AppBuilder::new(), + force_login: false, + } + } } impl<'a> Registration<'a> {