1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Taker intent classification for the matching engine.
//!
//! The kind of an incoming ("taker") order is orthogonal to its
//! [`TimeInForce`](crate::orders::TimeInForce): the TIF governs *how much* of
//! the remainder survives a match (fill-or-kill, immediate-or-cancel, rest),
//! while the [`TakerKind`] governs *whether the taker may take liquidity at
//! all* and how an unfilled remainder is interpreted by the order book. Both
//! are passed into [`PriceLevel::match_order`](crate::PriceLevel::match_order)
//! so the single-level match honors the taker's full intent.
use ;
/// Classifies the intent of an incoming (taker) order at a single price level.
///
/// This is the taker-side discriminator that
/// [`PriceLevel::match_order`](crate::PriceLevel::match_order) consults
/// alongside the taker's [`TimeInForce`](crate::orders::TimeInForce). It is
/// deliberately distinct from the resting-maker [`OrderType`](crate::OrderType):
/// it expresses what the *incoming* order is allowed to do, not how a resting
/// order behaves.
///
/// - [`TakerKind::Standard`] — an ordinary aggressing order. Subject only to
/// its TIF.
/// - [`TakerKind::PostOnly`] — must never take liquidity. If matching at this
/// level would cross (any quantity is available to fill), the match is
/// rejected with zero trades and the queue left untouched.
/// - [`TakerKind::MarketToLimit`] — fills the available quantity and reports
/// the remainder; the order book converts/rests the residual as a limit. At
/// the single-level layer this fills like a [`TakerKind::Standard`] taker.