pub struct CachedTrdAcc {Show 26 fields
pub acc_id: u64,
pub intra_acc_id: Option<u64>,
pub trd_env: i32,
pub trd_market_auth_list: Vec<i32>,
pub acc_type: Option<i32>,
pub card_num: Option<String>,
pub security_firm: Option<i32>,
pub sim_acc_type: Option<i32>,
pub competition_acc_name: Option<String>,
pub uni_card_num: Option<String>,
pub acc_status: Option<i32>,
pub acc_open_state: Option<i32>,
pub acc_role: Option<i32>,
pub acc_label: Option<String>,
pub jp_acc_type: Vec<i32>,
pub owner_uid: Option<u64>,
pub opr_uid: Option<u64>,
pub mixed_state: Option<i32>,
pub ira_type: Option<i32>,
pub grant_state: Option<i32>,
pub kouza_type: Option<i32>,
pub trd_market: Option<i32>,
pub association_acc_id: Option<u64>,
pub acc_flag: Option<i32>,
pub order_index: usize,
pub sort_key: u64,
}Expand description
缓存的账户信息
Fields§
§acc_id: u64账户 ID
intra_acc_id: Option<u64>后端/mobile native intra account id (C++ Ndt_Trd_AccItem.nIntraAccID).
公开 FTAPI acc_id 与 backend 查询 body 里的 account_id 不是同一层
语义。需要发 backend native account_id 的 handler 应优先用这个字段,
不要从公开 acc_id 低 32 位反推。
trd_env: i32交易环境(0=Simulate / 1=Real)
trd_market_auth_list: Vec<i32>该账户有权限访问的交易市场列表
acc_type: Option<i32>账户类型(Cash / Margin / Derivative / …)
card_num: Option<String>账户卡号(后段数字,仅用于显示识别)
security_firm: Option<i32>账户所属 broker(FutuHK=1 / FutuUS=2 / …)
sim_acc_type: Option<i32>模拟账户子类型
competition_acc_name: Option<String>C++ CMD14800 competition account title, exposed only when
sim_acc_type == SimAccType_Competition.
uni_card_num: Option<String>统一卡号(跨市场账户聚合标识)
acc_status: Option<i32>账户状态码(正常 / 冻结 / …)
acc_open_state: Option<i32>Backend raw FTUsrTrdAcc::Account.state.
C++ API layer keeps this distinct from public TrdAccStatus:
OPENED(1) is returned as Active, CLOSED(2) is returned in the
disabled-real tail, while OPENING(0) is skipped by
APIServer_Trd_GetAccList.cpp:109-115. Do not derive this back from
acc_status, because both CLOSED and OPENING are non-active.
acc_role: Option<i32>账户角色(主账户 / 子账户 / 顾问)
acc_label: Option<String>Daemon-derived user-visible account label.
Some opened business accounts are not representable by
Trd_Common.TrdMarket (for example crypto) or overload protocol role
values (for example equity-incentive / IPO route). The bridge derives a
label from backend account metadata and stores it here so public account
discovery does not rely on numeric market allowlists.
jp_acc_type: Vec<i32>日本账户附加类型标签
owner_uid: Option<u64>账户所有者 UID
opr_uid: Option<u64>账户操作者 UID
mixed_state: Option<i32>混合状态 (C++ enAccState / MixedState)
ira_type: Option<i32>IRA 类型 (CA: TFSA=1, RRSP=2, SRRSP=3)
grant_state: Option<i32>授权状态 (GrantState)
kouza_type: Option<i32>口座类型 (JP: Cash=1, Margin=2, Derivative=3)
trd_market: Option<i32>交易市场 (Account.market, 单个值)
association_acc_id: Option<u64>关联账户 ID (基金账户绑定)
acc_flag: Option<i32>综合账户子账户标志 (0=非子账户)
order_index: usize原始顺序索引 (用于保持后端返回的自然顺序)
sort_key: u64C++ 排序 key: (BrokerID << 48) | (TrdMkt << 32) | IntraAccID
Implementations§
Source§impl CachedTrdAcc
impl CachedTrdAcc
Sourcepub fn is_crypto_account(&self) -> bool
pub fn is_crypto_account(&self) -> bool
v1.4.108: identify crypto from bridge-derived backend metadata label.
Account discovery must not hide opened crypto accounts, but Trd_Common
has no public TrdMarket_Crypto variant. The bridge therefore derives
acc_label=crypto from FTUsrTrdAcc.AccountMarket::Crypto /
TradingCapability::NaCrypto; cache consumers should read that label
rather than re-hardcoding market numbers.
pub fn is_encrypted(&self) -> bool
Sourcepub fn derive_acc_label(&self) -> Option<&str>
pub fn derive_acc_label(&self) -> Option<&str>
v1.4.97 J-Acc-Q3 + v1.4.98 T2-6: derived acc_label for
/api/accounts REST response.
Priority order:
- bridge-derived backend label (
crypto,equity_incentive,ipo_route, …); "paper_trade"—trd_env==0 (Simulate)(v1.4.98).
Returns None for “no special label” (default Margin / regular Cash).
Spec: REST-only enrichment (no proto change for gRPC clients —
gRPC 不看 proto extension field, 只看 /api/accounts REST output).
Clients should treat unknown labels as opaque strings for forward
compatibility; new labels may appear when backend account categories are
surfaced through the bridge.
Labels are opaque strings for clients. Unknown labels should be rendered as-is rather than treated as an error.
Trait Implementations§
Source§impl AccountCardRecord for CachedTrdAcc
impl AccountCardRecord for CachedTrdAcc
Source§impl Clone for CachedTrdAcc
impl Clone for CachedTrdAcc
Source§fn clone(&self) -> CachedTrdAcc
fn clone(&self) -> CachedTrdAcc
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CachedTrdAcc
impl Debug for CachedTrdAcc
Source§impl Default for CachedTrdAcc
impl Default for CachedTrdAcc
Source§fn default() -> CachedTrdAcc
fn default() -> CachedTrdAcc
Auto Trait Implementations§
impl Freeze for CachedTrdAcc
impl RefUnwindSafe for CachedTrdAcc
impl Send for CachedTrdAcc
impl Sync for CachedTrdAcc
impl Unpin for CachedTrdAcc
impl UnsafeUnpin for CachedTrdAcc
impl UnwindSafe for CachedTrdAcc
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more