#[non_exhaustive]pub struct OrderPreview {
pub order_id: Option<String>,
pub order_strategy: Option<PreviewOrderStrategy>,
pub order_validation_result: OrderValidationResult,
pub commission_and_fee: Option<Value>,
pub extra: HashMap<String, Value>,
}Expand description
The answer to POST .../previewOrder: Schwab’s verdict on an order
without placing it.
A preview Schwab would refuse still answers 200; read
is_rejected (and the rejects) rather than the
HTTP status. Fields Schwab adds land in extra.
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.order_id: Option<String>§order_strategy: Option<PreviewOrderStrategy>§order_validation_result: OrderValidationResult§commission_and_fee: Option<Value>Commission and fee legs, as Schwab reports them.
extra: HashMap<String, Value>Implementations§
Source§impl OrderPreview
impl OrderPreview
Sourcepub fn is_rejected(&self) -> bool
pub fn is_rejected(&self) -> bool
Whether Schwab would refuse the order: a reject finding, or the
previewed strategy’s status REJECTED.
Sourcepub fn rejection_reasons(&self) -> Vec<&str>
pub fn rejection_reasons(&self) -> Vec<&str>
The reasons Schwab gave for refusing it.
Trait Implementations§
Source§impl Clone for OrderPreview
impl Clone for OrderPreview
Source§impl Debug for OrderPreview
impl Debug for OrderPreview
Source§impl Default for OrderPreview
impl Default for OrderPreview
Source§impl<'de> Deserialize<'de> for OrderPreviewwhere
OrderPreview: Default,
impl<'de> Deserialize<'de> for OrderPreviewwhere
OrderPreview: Default,
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 JsonSchema for OrderPreview
impl JsonSchema for OrderPreview
Source§fn schema_id() -> Cow<'static, str>
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
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
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 moreSource§impl PartialEq for OrderPreview
impl PartialEq for OrderPreview
Source§impl Serialize for OrderPreview
impl Serialize for OrderPreview
impl StructuralPartialEq for OrderPreview
Auto Trait Implementations§
impl Freeze for OrderPreview
impl RefUnwindSafe for OrderPreview
impl Send for OrderPreview
impl Sync for OrderPreview
impl Unpin for OrderPreview
impl UnsafeUnpin for OrderPreview
impl UnwindSafe for OrderPreview
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