pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Uses a 3x-ui API token for protected API endpoints.
Sourcepub const fn timeout(self, timeout: Duration) -> Self
pub const fn timeout(self, timeout: Duration) -> Self
Sets the total timeout for one HTTP request.
Sourcepub const fn connect_timeout(self, timeout: Duration) -> Self
pub const fn connect_timeout(self, timeout: Duration) -> Self
Sets the timeout for establishing a connection.
Sourcepub fn user_agent(self, user_agent: impl Into<String>) -> Self
pub fn user_agent(self, user_agent: impl Into<String>) -> Self
Overrides the user-agent sent by the SDK.
Sourcepub const fn danger_accept_invalid_certs(self, accept: bool) -> Self
pub const fn danger_accept_invalid_certs(self, accept: bool) -> Self
Accepts invalid TLS certificates.
Use this only for an explicitly trusted self-signed deployment. It weakens transport security for every request made by this client.
Sourcepub fn proxy(self, proxy: ProxyConfig) -> Self
pub fn proxy(self, proxy: ProxyConfig) -> Self
Routes panel HTTP requests and WebSocket connections through an explicit proxy.
Environment proxy variables are never consulted. Use
ProxyScheme::Socks5h when target DNS
resolution must happen on the proxy.
Sourcepub fn proxy_url(self, proxy_url: impl AsRef<str>) -> Result<Self>
pub fn proxy_url(self, proxy_url: impl AsRef<str>) -> Result<Self>
Parses and configures a credential-free proxy URL.
§Errors
Returns Error::Configuration for an invalid proxy URL. Configure
credentials with ProxyConfig::with_basic_auth and Self::proxy.
Sourcepub const fn response_body_limit(self, limit: usize) -> Self
pub const fn response_body_limit(self, limit: usize) -> Self
Sets the maximum in-memory size of an ordinary panel API response.
Both declared Content-Length and actually received chunked or
decompressed bytes are checked. Set a deliberately larger value for
deployments whose client lists, logs, or runtime OpenAPI exceed the
safe 64 MiB default.
Sourcepub const fn download_body_limit(self, limit: usize) -> Self
pub const fn download_body_limit(self, limit: usize) -> Self
Sets the maximum in-memory size of explicit database and migration downloads.
This is separate from Self::response_body_limit because backups are
expected to be substantially larger than structured API responses.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientBuilder
impl RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl UnwindSafe for ClientBuilder
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more