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: String
The API token to use for authentication.
user_agent: String
The user agent to use for the API requests. Defaults to replicate-rust/{version}
.
base_url: String
The 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 Freeze for Config
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