pub struct ClerkHttpClient { /* private fields */ }Expand description
Custom client wrapper that behaves like reqwest::Client but adds Clerk-specific functionality
Implementations§
Source§impl ClerkHttpClient
ClerkHttpClient that mimics ReqwestClient with pre and post hooks
To be able to run Clerk in non browser environment we need to
identify our selves to Clerk with Client Authorization header
We inject the header to the request and parse returned header
and keep the ClerkState updated with most current value
impl ClerkHttpClient
ClerkHttpClient that mimics ReqwestClient with pre and post hooks To be able to run Clerk in non browser environment we need to identify our selves to Clerk with Client Authorization header We inject the header to the request and parse returned header and keep the ClerkState updated with most current value
Sourcepub fn new(
client: ReqwestClient,
state: Arc<RwLock<ClerkState>>,
client_kind: ClientKind,
) -> Self
pub fn new( client: ReqwestClient, state: Arc<RwLock<ClerkState>>, client_kind: ClientKind, ) -> Self
Creates a new ClerkHttpClient
Sourcepub fn set_dev_browser_token_id(&self, token_id: String)
pub fn set_dev_browser_token_id(&self, token_id: String)
When running in browser one needs “DevBrowser auth” when running against Clerk development environment
pub async fn execute(&self, request: Request) -> Result<Response, Error>
pub fn request<U: IntoUrl>(&self, method: Method, url: U) -> RequestBuilder
pub fn get<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn post<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn put<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn patch<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn delete<U: IntoUrl>(&self, url: U) -> RequestBuilder
pub fn head<U: IntoUrl>(&self, url: U) -> RequestBuilder
Trait Implementations§
Source§impl Debug for ClerkHttpClient
impl Debug for ClerkHttpClient
Auto Trait Implementations§
impl !Freeze for ClerkHttpClient
impl !RefUnwindSafe for ClerkHttpClient
impl Send for ClerkHttpClient
impl Sync for ClerkHttpClient
impl Unpin for ClerkHttpClient
impl !UnwindSafe for ClerkHttpClient
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.