pub struct TradingFee {
pub symbol: String,
pub maker: Decimal,
pub taker: Decimal,
pub timestamp: Option<i64>,
pub datetime: Option<String>,
}Expand description
Trading fee information.
Fields§
§symbol: StringTrading symbol.
maker: DecimalMaker fee rate (0.001 = 0.1%).
taker: DecimalTaker fee rate (0.001 = 0.1%).
timestamp: Option<i64>Timestamp in milliseconds.
datetime: Option<String>Datetime string.
Implementations§
Source§impl TradingFee
impl TradingFee
Sourcepub fn new(
symbol: String,
maker: Decimal,
taker: Decimal,
timestamp: Option<i64>,
) -> TradingFee
pub fn new( symbol: String, maker: Decimal, taker: Decimal, timestamp: Option<i64>, ) -> TradingFee
Creates a new trading fee instance.
Sourcepub fn fee_difference(&self) -> Decimal
pub fn fee_difference(&self) -> Decimal
Calculates the difference between maker and taker fees.
Sourcepub fn maker_percentage(&self) -> Decimal
pub fn maker_percentage(&self) -> Decimal
Converts maker fee rate to percentage.
Sourcepub fn taker_percentage(&self) -> Decimal
pub fn taker_percentage(&self) -> Decimal
Converts taker fee rate to percentage.
Trait Implementations§
Source§impl Clone for TradingFee
impl Clone for TradingFee
Source§fn clone(&self) -> TradingFee
fn clone(&self) -> TradingFee
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TradingFee
impl Debug for TradingFee
Source§impl<'de> Deserialize<'de> for TradingFee
impl<'de> Deserialize<'de> for TradingFee
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TradingFee, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TradingFee, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for TradingFee
impl Serialize for TradingFee
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for TradingFee
impl RefUnwindSafe for TradingFee
impl Send for TradingFee
impl Sync for TradingFee
impl Unpin for TradingFee
impl UnwindSafe for TradingFee
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
Mutably borrows from an owned value. Read more