pub struct Credentials {
pub api_key: String,
pub api_secret: String,
pub passphrase: Option<String>,
pub testnet: bool,
}Expand description
Simple API key + secret credentials.
Used by connector constructors for the common HMAC-SHA256 case.
For the full multi-scheme credential model, use ExchangeCredentials.
Fields§
§api_key: String§api_secret: String§passphrase: Option<String>§testnet: boolWhether to connect to the exchange’s testnet/sandbox environment.
Defaults to false (production). Set to true to use testnet endpoints.
Implementations§
Source§impl Credentials
impl Credentials
pub fn new( api_key: impl Into<String>, api_secret: impl Into<String>, ) -> Credentials
pub fn with_passphrase(self, passphrase: impl Into<String>) -> Credentials
Sourcepub fn with_testnet(self, testnet: bool) -> Credentials
pub fn with_testnet(self, testnet: bool) -> Credentials
Set testnet mode.
When true, the connector will use the exchange’s testnet/sandbox endpoints.
Trait Implementations§
Source§impl Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
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 moreAuto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnsafeUnpin for Credentials
impl UnwindSafe for Credentials
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