pub struct EnvCredentials { /* private fields */ }Expand description
Credentials provider that reads from environment variables.
By default, reads from KRAKEN_API_KEY and KRAKEN_API_SECRET.
Implementations§
Source§impl EnvCredentials
impl EnvCredentials
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Create credentials from default environment variables.
Reads KRAKEN_API_KEY and KRAKEN_API_SECRET.
§Panics
Panics if the environment variables are not set.
Sourcepub fn from_env_vars(key_var: &str, secret_var: &str) -> Self
pub fn from_env_vars(key_var: &str, secret_var: &str) -> Self
Create credentials from custom environment variable names.
§Panics
Panics if the environment variables are not set.
Sourcepub fn try_from_env() -> Option<Self>
pub fn try_from_env() -> Option<Self>
Try to create credentials from default environment variables.
Returns None if the environment variables are not set.
Sourcepub fn try_from_env_vars(key_var: &str, secret_var: &str) -> Option<Self>
pub fn try_from_env_vars(key_var: &str, secret_var: &str) -> Option<Self>
Try to create credentials from custom environment variable names.
Returns None if the environment variables are not set.
Trait Implementations§
Source§impl CredentialsProvider for EnvCredentials
impl CredentialsProvider for EnvCredentials
Source§fn get_credentials(&self) -> &Credentials
fn get_credentials(&self) -> &Credentials
Get the credentials.
Auto Trait Implementations§
impl Freeze for EnvCredentials
impl RefUnwindSafe for EnvCredentials
impl Send for EnvCredentials
impl Sync for EnvCredentials
impl Unpin for EnvCredentials
impl UnwindSafe for EnvCredentials
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