pub struct Coupon {Show 32 fields
pub card_id: String,
pub card_type: String,
pub title: String,
pub title_sec: String,
pub description: String,
pub detail: String,
pub card_status: CouponStatus,
pub card_status_raw: Option<i32>,
pub start_time: Option<OffsetDateTime>,
pub end_time: Option<OffsetDateTime>,
pub no_expiry: bool,
pub activate_time: Option<OffsetDateTime>,
pub amount: Option<Decimal>,
pub currency: String,
pub available_trade_session: String,
pub trade_sessions: Vec<String>,
pub subscription_id: String,
pub ai_benefit: Option<CouponAiBenefit>,
pub cash: Option<CouponCash>,
pub coffee_coupon: Option<CouponCoffee>,
pub commission: Option<CouponCommission>,
pub crypto: Option<CouponCrypto>,
pub finance_interest: Option<CouponFinanceInterest>,
pub fund_deduct: Option<CouponFundDeduct>,
pub fundamental: Option<CouponQuote>,
pub ipo: Option<CouponIpo>,
pub ipo_commission: Option<CouponIpoCommission>,
pub ipo_interest: Option<CouponIpoInterest>,
pub platform_fee_deduct: Option<CouponPlatformFeeDeduct>,
pub quote: Option<CouponQuote>,
pub stock: Option<CouponStock>,
pub stock_fragment: Option<CouponStockFragment>,
}Expand description
A coupon (reward card)
The type-specific terms are in the field named after the coupon type
(commission, quote, stock, …); the fields of other types are
None. App styling (cover, background, …) and the server’s deprecated
top-level duplicates of the commission terms are not modelled, nor is the
fund_interest object, which the server does not describe.
Fields§
§card_id: StringCoupon ID (32 hex characters; pass to
crate::AssetContext::coupon_orders)
card_type: StringCoupon type, e.g. commission, platform_fee_deduct, stock,
quote, cash
title: StringTitle
title_sec: StringSecondary title
description: StringDescription
detail: StringTerms and details
card_status: CouponStatusStatus
card_status_raw: Option<i32>The server’s numeric code of card_status, also when it is a code this
SDK does not know (card_status is then Unknown); None when the
value is missing or is not a code
start_time: Option<OffsetDateTime>Start of validity
end_time: Option<OffsetDateTime>End of validity (None when not set or when the coupon never
expires; see Self::no_expiry)
no_expiry: boolWhether the coupon never expires (the server’s end time is in or after 2100)
activate_time: Option<OffsetDateTime>Activation time (None when not activated)
amount: Option<Decimal>Amount
currency: StringCurrency
available_trade_session: StringTrading sessions the coupon applies to, as display text
trade_sessions: Vec<String>Trading sessions the coupon applies to, as returned by the server
subscription_id: StringSubscription ID, as returned by the server
ai_benefit: Option<CouponAiBenefit>Terms of an AI benefit coupon
cash: Option<CouponCash>Terms of a cash coupon
coffee_coupon: Option<CouponCoffee>Terms of a coffee coupon
commission: Option<CouponCommission>Terms of a commission coupon
crypto: Option<CouponCrypto>Terms of a crypto coupon
finance_interest: Option<CouponFinanceInterest>Terms of a finance interest coupon
fund_deduct: Option<CouponFundDeduct>Terms of a fund deduction coupon
fundamental: Option<CouponQuote>Terms of a fundamental-data coupon
ipo: Option<CouponIpo>Terms of an IPO coupon
ipo_commission: Option<CouponIpoCommission>Terms of an IPO commission coupon
ipo_interest: Option<CouponIpoInterest>Terms of an IPO interest coupon
platform_fee_deduct: Option<CouponPlatformFeeDeduct>Terms of a platform fee deduction coupon
quote: Option<CouponQuote>Terms of a quote (market data) coupon
stock: Option<CouponStock>Terms of a stock coupon
stock_fragment: Option<CouponStockFragment>Terms of a stock fragment coupon
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Coupon
impl<'de> Deserialize<'de> for Coupon
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Auto Trait Implementations§
impl Freeze for Coupon
impl RefUnwindSafe for Coupon
impl Send for Coupon
impl Sync for Coupon
impl Unpin for Coupon
impl UnsafeUnpin for Coupon
impl UnwindSafe for Coupon
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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