pub struct ClientBuilder { /* private fields */ }Expand description
Options for a Client, created with Client::builder.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Reads the instance URL from CT_URL and the login token from CT_TOKEN,
leaving the other options to be set before build.
Sourcepub fn token(self, token: impl Into<Option<String>>) -> Self
pub fn token(self, token: impl Into<Option<String>>) -> Self
The login token, sent as Authorization: Login <token>.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Timeout for a whole request including reading the body (default 30 s).
Raise it for large downloads, uploads or slow exports.
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Timeout for establishing the connection (default 10 s, at most
timeout), so an unreachable host fails fast even
with a long request timeout.
Sourcepub fn max_response_size(self, bytes: u64) -> Self
pub fn max_response_size(self, bytes: u64) -> Self
Largest response body that is read (default
DEFAULT_MAX_RESPONSE_SIZE); larger ones fail with
Error::ResponseTooLarge instead of filling the memory.
Sourcepub fn allow_insecure_http(self, allow: bool) -> Self
pub fn allow_insecure_http(self, allow: bool) -> Self
Allows http:// for hosts other than localhost and loopback addresses.
The token then travels unencrypted; only for instances in a trusted network.