Skip to main content

Module config

Module config 

Source
Expand description

Client configuration: endpoint, token, account.

§Examples

use std::time::Duration;
use brokapi_tbank_protocol::{TbankConfig, SANDBOX_ENDPOINT};

let cfg = TbankConfig::sandbox("t.my-token")
    .with_account("2000123456")
    .with_app_name("me.my-robot")
    .with_request_timeout(Duration::from_secs(10));
assert_eq!(cfg.endpoint, SANDBOX_ENDPOINT);
assert!(cfg.sandbox);
// The token never shows in `Debug` output.
assert!(!format!("{cfg:?}").contains("t.my-token"));

Structs§

TbankConfig
gRPC client configuration. The token is never printed by Debug.

Constants§

PROD_ENDPOINT
Production gRPC endpoint.
SANDBOX_ENDPOINT
Sandbox gRPC endpoint (same services as production, virtual accounts).