Struct mangadex_api::web_scrape::builder::LoginAjaxBuilder [−][src]
Builder for the /ajax/actions.ajax.php?function=login
endpoint.
Fields
md_client: &'a (dyn MangaDexClient + 'a)
username: String
password: String
remember_me: bool
two_factor_code: Option<String>
Implementations
impl<'a> LoginAjaxBuilder<'a>
[src]
pub fn new<T: Into<String>>(
md_client: &'a dyn MangaDexClient,
username: T,
password: T
) -> LoginAjaxBuilder<'a>
[src]
md_client: &'a dyn MangaDexClient,
username: T,
password: T
) -> LoginAjaxBuilder<'a>
Create a new builder instance for logging in via the AJAX endpoint.
Parameters
username
: MangaDex username.password
: Plain-text MangaDex password.
pub fn remember_me(&mut self, remember_me: bool) -> &mut Self
[src]
Toggle the “Remember me” flag to increase the session length from 1 day to 1 year.
pub fn two_factor<T: Into<String>>(&mut self, two_factor_code: T) -> &mut Self
[src]
Set the 2-factor 6-digit TOTP authentication code.
This can be used in the same request as the login.
pub async fn send(&self) -> Result<LoginAjaxResponseType, Error>
[src]
Send the request to MangaDex.
If the response type is LoginAjaxResponseType::TwoFactorAuthenticationRequired
,
retry the request using the two_factor()
method before sending to send the 2FA code.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for LoginAjaxBuilder<'a>
impl<'a> !Send for LoginAjaxBuilder<'a>
impl<'a> !Sync for LoginAjaxBuilder<'a>
impl<'a> Unpin for LoginAjaxBuilder<'a>
impl<'a> !UnwindSafe for LoginAjaxBuilder<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,