pub struct RobloxCsrfTokenStore(/* private fields */);
Implementations§
Source§impl RobloxCsrfTokenStore
impl RobloxCsrfTokenStore
pub fn new() -> Self
Sourcepub fn set_csrf_token_from_headers(&self, headers: &HeaderMap) -> bool
pub fn set_csrf_token_from_headers(&self, headers: &HeaderMap) -> bool
Updates the auth instance’s CSRF token from a response’s headers map if it is different from the current value. Returns a boolean indicating whether a new value was found from the headers map.
Sourcepub async fn send_request<F, Fut>(
&self,
req_factory: F,
) -> Result<Response, CsrfTokenRequestError>
pub async fn send_request<F, Fut>( &self, req_factory: F, ) -> Result<Response, CsrfTokenRequestError>
Given a factory function to construct a request, send a request using the CSRF token store. If the
request fails with status 403 and the response contains a new X-CSRF-Token
header, the request will
be reconstructed and retried.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RobloxCsrfTokenStore
impl !RefUnwindSafe for RobloxCsrfTokenStore
impl Send for RobloxCsrfTokenStore
impl Sync for RobloxCsrfTokenStore
impl Unpin for RobloxCsrfTokenStore
impl UnwindSafe for RobloxCsrfTokenStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more