#[non_exhaustive]pub struct PositionBook {
pub instrument: Option<InstrumentName>,
pub time: Option<DateTime>,
pub price: Option<PriceValue>,
pub bucket_width: Option<PriceValue>,
pub buckets: Vec<PositionBookBucket>,
pub unix_time: Option<DateTime>,
}Expand description
The representation of an instrument’s position book at a point in time
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.instrument: Option<InstrumentName>The position book’s instrument
time: Option<DateTime>The time when the position book snapshot was created
price: Option<PriceValue>The price (midpoint) for the position book’s instrument at the time of the position book snapshot
bucket_width: Option<PriceValue>The price width for each bucket. Each bucket covers the price range from the bucket’s price to the bucket’s price + bucketWidth.
buckets: Vec<PositionBookBucket>The partitioned position book, divided into buckets using a default bucket width. These buckets are only provided for price ranges which actually contain order or position data.
unix_time: Option<DateTime>The book’s creation time as a Unix timestamp (seconds), string-encoded. This field is returned by the live v20 API but is not present in OANDA’s official documentation.
Trait Implementations§
Source§impl Clone for PositionBook
impl Clone for PositionBook
Source§fn clone(&self) -> PositionBook
fn clone(&self) -> PositionBook
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PositionBook
impl Debug for PositionBook
Source§impl<'de> Deserialize<'de> for PositionBook
impl<'de> Deserialize<'de> for PositionBook
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PositionBook
impl PartialEq for PositionBook
Source§impl Serialize for PositionBook
impl Serialize for PositionBook
impl StructuralPartialEq for PositionBook
Auto Trait Implementations§
impl Freeze for PositionBook
impl RefUnwindSafe for PositionBook
impl Send for PositionBook
impl Sync for PositionBook
impl Unpin for PositionBook
impl UnsafeUnpin for PositionBook
impl UnwindSafe for PositionBook
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