Skip to main content

TrdAcc

Struct TrdAcc 

Source
pub struct TrdAcc {
Show 21 fields pub id: u64, pub broker: Broker, pub market_id: i32, pub intra_acc_id: u32, pub user_profile: UserProfile, pub type: i32, pub state: i32, pub card_number: String, pub trade_disable: bool, pub self_trade_disable: bool, pub loan_enable: bool, pub self_loan_enable: bool, pub has_trade_pswd: bool, pub mixed_state: i32, pub trade_pswd_is_6digit: bool, pub acc_business_name: Vec<AccBusinessName>, pub acc_diy_name: Option<String>, pub optional_uid64: Option<u64>, pub new_market_id: u32, pub enable_market: Vec<u32>, pub grant_state: Option<i32>,
}
Expand description

业务账户(仅2008协议依赖)

Fields§

§id: u64

账户ID,唯一标记一个业务账户(跨券商唯一)

§broker: Broker

由brokerID(16bit)+marketID(16bit,后端)+accountID(32bit)组成的64位长ID

所属券商

§market_id: i32

旧市场类型,取值参考:MarketId枚举(客户端A股通以后版本该字段废弃,使用new_market_id)

§intra_acc_id: u32

业务账户ID,即后端的accountID

§user_profile: UserProfile

账户所有者资料(废弃)

§type: i32

业务账户融资类型,取值参考Type枚举

§state: i32

业务账户状态,取值参考State枚举

§card_number: String

业务账户16位卡号

§trade_disable: bool

后台是否禁止该业务账户的交易能力

§self_trade_disable: bool

用户自己是否禁止该业务账户的交易能力

§loan_enable: bool

后台是否允许该业务账户使用融资能力

§self_loan_enable: bool

用户自己是否允许该业务账户使用融资能力

§has_trade_pswd: bool

是否已经设置了交易密码

§mixed_state: i32

混合状态(只会返回3,4),取值参考MixedState枚举

§trade_pswd_is_6digit: bool

交易密码是否是6位数字密码

§acc_business_name: Vec<AccBusinessName>

账户业务名称(ESOP专有账户名称)

§acc_diy_name: Option<String>

业务账户自定义别名(废弃,后端返回空)

§optional_uid64: Option<u64>

账户操作者uid(以前富途HK交易社会化引入的,现在该功能已下线,当前取值为账户归属人UID)

§new_market_id: u32

新的市场类型(客户端A股通以后版本使用该字段取代market_id字段)

§enable_market: Vec<u32>

取值参考:港股0/美股1/A股通3/期货4/证券账户6/港币13/美元23 这个取值比较奇怪,有疑问参考介绍文档或者联系服务方

交易市场,取值参考TradeMarket枚举

§grant_state: Option<i32>

授权状态(以前富途HK交易社会化引入的,废弃,默认取0)

Implementations§

Source§

impl TrdAcc

Source

pub fn market_id(&self) -> MarketId

Returns the enum value of market_id, or the default if the field is set to an invalid enum value.

Source

pub fn set_market_id(&mut self, value: MarketId)

Sets market_id to the provided enum value.

Source

pub fn type(&self) -> Type

Returns the enum value of type, or the default if the field is set to an invalid enum value.

Source

pub fn set_type(&mut self, value: Type)

Sets type to the provided enum value.

Source

pub fn state(&self) -> State

Returns the enum value of state, or the default if the field is set to an invalid enum value.

Source

pub fn set_state(&mut self, value: State)

Sets state to the provided enum value.

Source

pub fn mixed_state(&self) -> MixedState

Returns the enum value of mixed_state, or the default if the field is set to an invalid enum value.

Source

pub fn set_mixed_state(&mut self, value: MixedState)

Sets mixed_state to the provided enum value.

Source

pub fn acc_diy_name(&self) -> &str

Returns the value of acc_diy_name, or the default value if acc_diy_name is unset.

Source

pub fn optional_uid64(&self) -> u64

Returns the value of optional_uid64, or the default value if optional_uid64 is unset.

Source

pub fn grant_state(&self) -> GrantState

Returns the enum value of grant_state, or the default if the field is unset or set to an invalid enum value.

Source

pub fn set_grant_state(&mut self, value: GrantState)

Sets grant_state to the provided enum value.

Trait Implementations§

Source§

impl Clone for TrdAcc

Source§

fn clone(&self) -> TrdAcc

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TrdAcc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TrdAcc

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Message for TrdAcc

Source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
Source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
Source§

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message to a buffer. Read more
Source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
Source§

fn encode_length_delimited( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
Source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
Source§

fn decode(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes an instance of the message from a buffer. Read more
Source§

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

Decodes a length-delimited instance of the message from the buffer.
Source§

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
Source§

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>
where Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
Source§

impl PartialEq for TrdAcc

Source§

fn eq(&self, other: &TrdAcc) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TrdAcc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more