pub struct RunpodBuilder { /* private fields */ }Expand description
Builder for RunpodConfig.
Implementations§
Source§impl RunpodBuilder
impl RunpodBuilder
Sourcepub fn with_api_key<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn with_api_key<VALUE: Into<String>>(self, value: VALUE) -> Self
API key for authentication with the Runpod API.
You can obtain your API key from the Runpod dashboard.
Sourcepub fn with_rest_url<VALUE: Into<String>>(self, value: VALUE) -> Self
pub fn with_rest_url<VALUE: Into<String>>(self, value: VALUE) -> Self
Base REST URL for the Runpod API.
Defaults to the official Runpod REST API endpoint.
Sourcepub fn with_api_url<VALUE: Into<String>>(self, value: VALUE) -> Self
Available on crate feature serverless only.
pub fn with_api_url<VALUE: Into<String>>(self, value: VALUE) -> Self
serverless only.Base API URL for the Runpod serverless endpoints.
Defaults to the official Runpod API endpoint.
Sourcepub fn with_timeout<VALUE: Into<Duration>>(self, value: VALUE) -> Self
pub fn with_timeout<VALUE: Into<Duration>>(self, value: VALUE) -> Self
Timeout for HTTP requests.
Controls how long the client will wait for API responses before timing out.
Sourcepub fn with_client<VALUE: Into<Client>>(self, value: VALUE) -> Self
pub fn with_client<VALUE: Into<Client>>(self, value: VALUE) -> Self
Optional custom reqwest client.
If provided, this client will be used instead of creating a new one. This allows for custom configuration of the HTTP client (e.g., proxies, custom headers, etc.).
Sourcepub fn build(self) -> Result<RunpodConfig, RunpodBuilderError>
pub fn build(self) -> Result<RunpodConfig, RunpodBuilderError>
Source§impl RunpodBuilder
impl RunpodBuilder
Sourcepub fn build_client(self) -> Result<RunpodClient>
pub fn build_client(self) -> Result<RunpodClient>
Creates a RunPod API client directly from the builder.
This is a convenience method that builds the configuration and creates a client in one step. This is the recommended way to create a client.
§Examples
let client = RunpodConfig::builder()
.with_api_key("your-api-key")
.build_client()
.unwrap();