pub struct ClientOptions {
pub auto_refresh_token: bool,
pub persist_session: bool,
pub detect_session_in_url: bool,
pub headers: HashMap<String, String>,
pub fetch_options: Option<Value>,
}
Expand description
Client options for configuring the Supabase client
Fields§
§auto_refresh_token: bool
Auto refresh token when it’s about to expire
persist_session: bool
Persist session in memory
detect_session_in_url: bool
Detect session from URL query parameters
headers: HashMap<String, String>
Headers to be sent with each request
fetch_options: Option<Value>
Global fetch options (for future compatibility)
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub fn with_auto_refresh_token(self, auto_refresh_token: bool) -> Self
pub fn with_auto_refresh_token(self, auto_refresh_token: bool) -> Self
Set whether to auto refresh token
Sourcepub fn with_persist_session(self, persist_session: bool) -> Self
pub fn with_persist_session(self, persist_session: bool) -> Self
Set whether to persist session
Sourcepub fn with_detect_session_in_url(self, detect_session_in_url: bool) -> Self
pub fn with_detect_session_in_url(self, detect_session_in_url: bool) -> Self
Set whether to detect session from URL
Sourcepub fn with_header(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a header to be sent with each request
Sourcepub fn with_fetch_options(self, fetch_options: Value) -> Self
pub fn with_fetch_options(self, fetch_options: Value) -> Self
Set fetch options
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ClientOptions
impl Debug for ClientOptions
Auto Trait Implementations§
impl Freeze for ClientOptions
impl RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl UnwindSafe for ClientOptions
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