Skip to main content

TrdMarketEnum

Enum TrdMarketEnum 

Source
#[non_exhaustive]
pub enum TrdMarketEnum { HK, US, CN, HKCC, Futures, SG, AU, JP, MY, CA, HKFund, USFund, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

HK

§

US

§

CN

§

HKCC

§

Futures

§

SG

§

AU

§

JP

§

MY

§

CA

§

HKFund

v1.4.102 fund-market handoff (per pitfall #54): view-only HKFUND/USFUND 融资融券 / 基金账户. C++ NN_TrdMarket_HK_Fund=113, NN_TrdMarket_US_Fund=123. cash-log backend Market enum 用 13/23, 翻译见 cash_log_market_for_trd_market in cash_log.rs.

§

USFund

Implementations§

Source§

impl TrdMarketEnum

Source

fn from_proto_variant(p: ProtoTrdMarket) -> Option<Self>

v1.4.93 C3 (Option D): map a prost-generated ProtoTrdMarket to our exposed subset.

proto variants we don’t expose (return None):

  • Unknown (=0) — invalid placeholder
  • FuturesSimulateHk/Us/Sg/Jp (=10..=13) — separate sim plumbing
  • SgFund / MyFund / JpFund / CaFund — not verified in Rust surface yet

Trait Implementations§

Source§

impl Clone for TrdMarketEnum

Source§

fn clone(&self) -> TrdMarketEnum

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 TrdMarketEnum

Source§

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

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

impl From<TrdMarketEnum> for i32

Source§

fn from(t: TrdMarketEnum) -> Self

Converts to this type from the input type.
Source§

impl JsonSchema for TrdMarketEnum

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for TrdMarketEnum

Source§

fn eq(&self, other: &TrdMarketEnum) -> 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 Serialize for TrdMarketEnum

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToolEnum for TrdMarketEnum

Source§

fn from_str(s: &str) -> Option<Self>

v1.4.93 C3 (Option D): delegate canonical-name lookup to prost-generated ProtoTrdMarket::from_str_name, then map exposed variants to our local enum. Hand-written short names ("HK" / "FUTURES" / …) keep working as a friendly-alias fallback so LLM agents can use either form.

This consolidates the two enum-name lists (proto canonical + tool short) down to one source of truth (proto). Adding a new proto variant only requires extending Self::from_proto_variant one arm. Unrecognised proto variants are intentionally rejected until the corresponding runtime route has evidence; HK_Fund / US_Fund are the currently exposed fund variants.

Source§

fn type_name() -> &'static str

用于 error message 的人类可读类型名(如 "market" / "order_type"
Source§

fn from_i32(v: i32) -> Option<Self>

按 proto int 值查 enum variant;未定义 → None
Source§

fn as_i32(self) -> i32

返 proto int 值(用于 serialize / handler 下游)
Source§

fn all_int_values() -> Vec<i32>

列举所有合法 int 值(用于 error message)
Source§

fn all_string_values() -> Vec<&'static str>

列举所有 canonical string 名(用于 error message / schema hints)
Source§

impl Copy for TrdMarketEnum

Source§

impl Eq for TrdMarketEnum

Source§

impl StructuralPartialEq for TrdMarketEnum

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> DynClone for T
where T: Clone,

§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

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