Struct replicate_rust::config::Config
source · pub struct Config {
pub auth: String,
pub user_agent: String,
pub base_url: String,
}Expand description
The Config struct is used to initialize configuration for the API. Currently contains the API token, the user agent and the base url.
Fields§
§auth: StringThe API token to use for authentication.
user_agent: StringThe user agent to use for the API requests. Defaults to replicate-rust/{version}.
base_url: StringThe base url to use for the API requests. Defaults to https://api.replicate.com/v1.
Implementations§
source§impl Config
impl Config
sourcepub fn check_auth(&self)
pub fn check_auth(&self)
Check if auth is set and exit if not.
The auth token can be set in the environment variable REPLICATE_API_TOKEN.
Otherwise, it can be set in the Config struct.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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