Struct fxoanda::ClientPrice

source ·
pub struct ClientPrice {
    pub status: Option<String>,
    pub quote_home_conversion_factors: Option<QuoteHomeConversionFactors>,
    pub asks: Option<Vec<PriceBucket>>,
    pub units_available: Option<UnitsAvailable>,
    pub closeout_bid: Option<f32>,
    pub bids: Option<Vec<PriceBucket>>,
    pub instrument: Option<String>,
    pub time: Option<DateTime<Utc>>,
    pub closeout_ask: Option<f32>,
    pub otype: Option<String>,
    pub tradeable: Option<bool>,
}

Fields§

§status: Option<String>

The status of the Price.

§quote_home_conversion_factors: Option<QuoteHomeConversionFactors>

QuoteHomeConversionFactors represents the factors that can be used used to convert quantities of a Price’s Instrument’s quote currency into the Account’s home currency.

§asks: Option<Vec<PriceBucket>>

The list of prices and liquidity available on the Instrument’s ask side. It is possible for this list to be empty if there is no ask liquidity currently available for the Instrument in the Account.

§units_available: Option<UnitsAvailable>

Representation of how many units of an Instrument are available to be traded by an Order depending on its postionFill option.

§closeout_bid: Option<f32>

The closeout bid Price. This Price is used when a bid is required to closeout a Position (margin closeout or manual) yet there is no bid liquidity. The closeout bid is never used to open a new position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.

§bids: Option<Vec<PriceBucket>>

The list of prices and liquidity available on the Instrument’s bid side. It is possible for this list to be empty if there is no bid liquidity currently available for the Instrument in the Account.

§instrument: Option<String>

The Price’s Instrument. format: A string containing the base currency and quote currency delimited by a “_”.

§time: Option<DateTime<Utc>>

The date/time when the Price was created format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

§closeout_ask: Option<f32>

The closeout ask Price. This Price is used when a ask is required to closeout a Position (margin closeout or manual) yet there is no ask liquidity. The closeout ask is never used to open a new position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.

§otype: Option<String>

The string “PRICE”. Used to identify the a Price object when found in a stream.

§tradeable: Option<bool>

Flag indicating if the Price is tradeable or not

Implementations§

source§

impl ClientPrice

source

pub fn new() -> ClientPrice

source

pub fn with_status(self, x: String) -> ClientPrice

The status of the Price.

  • param String
  • return ClientPrice
source

pub fn with_quote_home_conversion_factors( self, x: QuoteHomeConversionFactors ) -> ClientPrice

QuoteHomeConversionFactors represents the factors that can be used used to convert quantities of a Price’s Instrument’s quote currency into the Account’s home currency.

  • param QuoteHomeConversionFactors
  • return ClientPrice
source

pub fn with_asks(self, x: Vec<PriceBucket>) -> ClientPrice

The list of prices and liquidity available on the Instrument’s ask side. It is possible for this list to be empty if there is no ask liquidity currently available for the Instrument in the Account.

  • param Vec
  • return ClientPrice
source

pub fn with_units_available(self, x: UnitsAvailable) -> ClientPrice

Representation of how many units of an Instrument are available to be traded by an Order depending on its postionFill option.

  • param UnitsAvailable
  • return ClientPrice
source

pub fn with_closeout_bid(self, x: f32) -> ClientPrice

The closeout bid Price. This Price is used when a bid is required to closeout a Position (margin closeout or manual) yet there is no bid liquidity. The closeout bid is never used to open a new position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.

  • param f32
  • return ClientPrice
source

pub fn with_bids(self, x: Vec<PriceBucket>) -> ClientPrice

The list of prices and liquidity available on the Instrument’s bid side. It is possible for this list to be empty if there is no bid liquidity currently available for the Instrument in the Account.

  • param Vec
  • return ClientPrice
source

pub fn with_instrument(self, x: String) -> ClientPrice

The Price’s Instrument. format: A string containing the base currency and quote currency delimited by a “_”.

  • param String
  • return ClientPrice
source

pub fn with_time(self, x: DateTime<Utc>) -> ClientPrice

The date/time when the Price was created format: The RFC 3339 representation is a string conforming to https://tools.ietf.org/rfc/rfc3339.txt. The Unix representation is a string representing the number of seconds since the Unix Epoch (January 1st, 1970 at UTC). The value is a fractional number, where the fractional part represents a fraction of a second (up to nine decimal places).

  • param DateTime
  • return ClientPrice
source

pub fn with_closeout_ask(self, x: f32) -> ClientPrice

The closeout ask Price. This Price is used when a ask is required to closeout a Position (margin closeout or manual) yet there is no ask liquidity. The closeout ask is never used to open a new position. format: A decimal number encodes as a string. The amount of precision provided depends on the Instrument.

  • param f32
  • return ClientPrice
source

pub fn with_otype(self, x: String) -> ClientPrice

The string “PRICE”. Used to identify the a Price object when found in a stream.

  • param String
  • return ClientPrice
source

pub fn with_tradeable(self, x: bool) -> ClientPrice

Flag indicating if the Price is tradeable or not

  • param bool
  • return ClientPrice

Trait Implementations§

source§

impl Debug for ClientPrice

source§

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

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

impl<'de> Deserialize<'de> for ClientPrice

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<ClientPrice, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for ClientPrice

source§

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§

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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

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

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

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.
source§

impl<T> WithSubscriber for T

source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,