pub struct ApiKeyPair { /* private fields */ }Implementations§
Source§impl ApiKeyPair
impl ApiKeyPair
pub fn new(profile_name: String, key: String, secret: String) -> ApiKeyPair
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Load API credentials from environment variables.
Reads BYBIT_API_KEY and BYBIT_API_SECRET.
Optionally loads .env file via dotenvy.
§Example
ⓘ
// .env file or environment:
// BYBIT_API_KEY=your_key
// BYBIT_API_SECRET=your_secret
dotenvy::dotenv().ok(); // load .env if present
let keys = ApiKeyPair::from_env()?;Sourcepub fn from_env_testnet() -> Result<Self>
pub fn from_env_testnet() -> Result<Self>
Load API credentials from Testnet environment variables.
Reads BYBIT_TESTNET_API_KEY and BYBIT_TESTNET_API_SECRET.
pub fn profile_name(&self) -> &str
pub fn key(&self) -> &str
pub fn secret(&self) -> &str
Trait Implementations§
Source§impl Clone for ApiKeyPair
impl Clone for ApiKeyPair
Source§fn clone(&self) -> ApiKeyPair
fn clone(&self) -> ApiKeyPair
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiKeyPair
impl Debug for ApiKeyPair
Source§impl<'de> Deserialize<'de> for ApiKeyPair
impl<'de> Deserialize<'de> for ApiKeyPair
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ApiKeyPair
impl RefUnwindSafe for ApiKeyPair
impl Send for ApiKeyPair
impl Sync for ApiKeyPair
impl Unpin for ApiKeyPair
impl UnsafeUnpin for ApiKeyPair
impl UnwindSafe for ApiKeyPair
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