Registration::new_with_client

Registration can now be created with a custom Reqwest Client.
This commit is contained in:
baummarten 2023-01-12 17:01:33 +01:00 committed by Scott Boggs
parent c93e5a5020
commit 72d158513c
1 changed files with 16 additions and 0 deletions

View File

@ -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<I: Into<String>>(base: I, client: Client) -> Self {
Registration {
base: base.into(),
client,
app_builder: AppBuilder::new(),
force_login: false,
}
}
}
impl<'a> Registration<'a> {