pub struct OrderOwnedView(/* private fields */);Expand description
Self-contained, 'static owned view of a Order message.
Wraps ::buffa::OwnedView<OrderView<'static>>: the decoded view and the ::buffa::bytes::Bytes buffer it borrows from travel together, so the handle is 'static and Send + Sync — suitable for async handlers, spawned tasks, and anywhere a 'static bound is required.
Field accessors return borrows tied to &self. Use Self::view to get the full OrderView when you need struct patterns, iteration helpers, or to pass the view to lifetime-parameterised code.
Implementations§
Source§impl OrderOwnedView
impl OrderOwnedView
Sourcepub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
pub fn decode(bytes: Bytes) -> Result<Self, DecodeError>
Decode an owned view from a ::buffa::bytes::Bytes buffer.
The view borrows directly from the buffer’s data; the buffer is retained inside the returned handle.
§Errors
Returns ::buffa::DecodeError if the buffer contains invalid
protobuf data.
Sourcepub fn decode_with_options(
bytes: Bytes,
opts: &DecodeOptions,
) -> Result<Self, DecodeError>
pub fn decode_with_options( bytes: Bytes, opts: &DecodeOptions, ) -> Result<Self, DecodeError>
Decode with custom ::buffa::DecodeOptions (recursion limit,
max message size).
§Errors
Returns ::buffa::DecodeError if the buffer is invalid or
exceeds the configured limits.
Sourcepub fn from_owned(msg: &Order) -> Result<Self, DecodeError>
pub fn from_owned(msg: &Order) -> Result<Self, DecodeError>
Build from an owned message via an encode → decode round-trip.
§Errors
Returns ::buffa::DecodeError if the re-encoded bytes are
somehow invalid (should not happen for well-formed messages).
Sourcepub fn view(&self) -> &OrderView<'_>
pub fn view(&self) -> &OrderView<'_>
Borrow the full OrderView with its lifetime tied to &self.
Sourcepub fn to_owned_message(&self) -> Result<Order, DecodeError>
pub fn to_owned_message(&self) -> Result<Order, DecodeError>
Convert to the owned message type.
§Errors
Returns an error if re-materializing preserved unknown fields fails (e.g. the unknown-field limit is exceeded).
Sourcepub fn into_bytes(self) -> Bytes
pub fn into_bytes(self) -> Bytes
Consume the handle, returning the underlying bytes buffer.
Sourcepub fn client_order_id(&self) -> &str
pub fn client_order_id(&self) -> &str
Client-provided id for idempotency/correlation (may be empty).
Field 4: client_order_id
Sourcepub fn status(&self) -> EnumValue<OrderStatus>
pub fn status(&self) -> EnumValue<OrderStatus>
Current order lifecycle status.
Field 6: status
Sourcepub fn order_type(&self) -> EnumValue<OrderType>
pub fn order_type(&self) -> EnumValue<OrderType>
Order type.
Field 7: order_type
Sourcepub fn time_in_force(&self) -> EnumValue<TimeInForce>
pub fn time_in_force(&self) -> EnumValue<TimeInForce>
Time-in-force policy.
Field 8: time_in_force
Sourcepub fn self_trade_prevention_mode(&self) -> EnumValue<SelfTradePreventionMode>
pub fn self_trade_prevention_mode(&self) -> EnumValue<SelfTradePreventionMode>
Self-trade prevention mode.
Field 9: self_trade_prevention_mode
Sourcepub fn fee_asset(&self) -> EnumValue<FeeAsset>
pub fn fee_asset(&self) -> EnumValue<FeeAsset>
Fee asset selected for fills. This also determines the decode scale for fee_scaled and referral_share_scaled on user trade rows.
Field 10: fee_asset
Sourcepub fn post_only(&self) -> bool
pub fn post_only(&self) -> bool
True if the order was submitted as post-only (maker-only).
Field 11: post_only
Sourcepub fn orig_qty_scaled(&self) -> i64
pub fn orig_qty_scaled(&self) -> i64
Original order quantity scaled by the pair’s base_quantity_scale from GetSpotConfig for symbol_id.
Field 12: orig_qty_scaled
Sourcepub fn cum_qty_scaled(&self) -> i64
pub fn cum_qty_scaled(&self) -> i64
Cumulative filled quantity scaled by the pair’s base_quantity_scale from GetSpotConfig for symbol_id.
Field 13: cum_qty_scaled
Sourcepub fn leaves_qty_scaled(&self) -> i64
pub fn leaves_qty_scaled(&self) -> i64
Remaining working quantity scaled by the pair’s base_quantity_scale from GetSpotConfig for symbol_id. Zero for terminal orders.
Field 20: leaves_qty_scaled
Sourcepub fn avg_price_ticks(&self) -> i64
pub fn avg_price_ticks(&self) -> i64
Average fill price in quote units scaled by 1e6. Zero if no fills.
Field 14: avg_price_ticks
Sourcepub fn price_ticks(&self) -> i64
pub fn price_ticks(&self) -> i64
Limit price in quote units scaled by 1e6. Zero for MARKET orders.
Field 15: price_ticks
Sourcepub fn created_ts_ns(&self) -> u64
pub fn created_ts_ns(&self) -> u64
Creation timestamp in nanoseconds since epoch (UTC).
Field 16: created_ts_ns
Sourcepub fn terminal_ts_ns(&self) -> u64
pub fn terminal_ts_ns(&self) -> u64
Terminal timestamp in nanoseconds since epoch (UTC). Zero for open orders.
Field 17: terminal_ts_ns
Sourcepub fn terminal_reason_code(&self) -> u32
pub fn terminal_reason_code(&self) -> u32
Terminal reason code for canceled/rejected orders. Zero for non-terminal orders.
Field 18: terminal_reason_code
Sourcepub fn terminal_reason(&self) -> &str
pub fn terminal_reason(&self) -> &str
Stable string for terminal_reason_code (e.g. “POST_ONLY_CROSS”, “USER_REQUEST”). Empty for non-terminal orders.
Field 19: terminal_reason
Sourcepub fn attached_risk(&self) -> &MessageFieldView<AttachedRiskView<'_>>
pub fn attached_risk(&self) -> &MessageFieldView<AttachedRiskView<'_>>
Attached risk controls + runtime state on the parent order. Empty when no attached risk exists.
Field 21: attached_risk
Sourcepub fn origin(&self) -> &MessageFieldView<OrderOriginView<'_>>
pub fn origin(&self) -> &MessageFieldView<OrderOriginView<'_>>
Runtime lineage metadata (why the order exists and what generated it).
Field 22: origin
Sourcepub fn market_client_ref_price_ticks(&self) -> i64
pub fn market_client_ref_price_ticks(&self) -> i64
Optional client-side reference price used for MARKET slippage protection, in quote units scaled by 1e6.
Field 23: market_client_ref_price_ticks
Sourcepub fn market_max_slippage_ticks(&self) -> i32
pub fn market_max_slippage_ticks(&self) -> i32
Optional MARKET max slippage as a price delta in 1e-6 quote-unit ticks.
Field 24: market_max_slippage_ticks
Sourcepub fn market_max_slippage_bps(&self) -> i32
pub fn market_max_slippage_bps(&self) -> i32
Optional MARKET max slippage in basis points (1 bp = 0.01%).
Field 25: market_max_slippage_bps
Sourcepub fn version(&self) -> u32
pub fn version(&self) -> u32
Per-order state version. Starts at 1 and increases for every published state change. Use this field to reconcile API and realtime updates.
Field 26: version
Sourcepub fn batch_request_id(&self) -> u64
pub fn batch_request_id(&self) -> u64
Batch-replace identity that admitted this order. Zero for other origins.
Field 27: batch_request_id
Sourcepub fn submitted_max_quote_debit_scaled(&self) -> Option<i64>
pub fn submitted_max_quote_debit_scaled(&self) -> Option<i64>
Submitted hard all-in quote debit limit, scaled by the pair’s quote_quantity_scale from GetSpotConfig. Present only when that sizing method was submitted.
Field 28: submitted_max_quote_debit_scaled
Trait Implementations§
Source§impl Clone for OrderOwnedView
impl Clone for OrderOwnedView
Source§fn clone(&self) -> OrderOwnedView
fn clone(&self) -> OrderOwnedView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more