MCPcopy Create free account

hub / github.com/CheetahExchange/orderbook-rs / functions

Functions115 in github.com/CheetahExchange/orderbook-rs

↓ 24 callersMethodset
(&mut self, k: u64, v: bool)
src/utils/bitmap.rs:37
↓ 18 callersFunctionsend_order
(producer: &FutureProducer<DefaultClientContext>, order: &Order)
tests/integration_test.rs:52
↓ 17 callersFunctioncreate_order
( order_id: u64, user_id: u64, side: Side, price: Decimal, size: Decimal, order_type:
tests/integration_test.rs:26
↓ 14 callersMethodget
(&self, k: u64)
src/utils/bitmap.rs:25
↓ 10 callersMethoddecr_size
(&mut self, order_id: u64, size: &Decimal)
src/matching/depth.rs:22
↓ 10 callersFunctionmake_snowflake_id
(relative_timestamp_ms: i64, node_id: u64, sequence: u64)
src/utils/time_window.rs:265
↓ 9 callersMethodnext_log_seq
(&mut self)
src/matching/order_book.rs:625
↓ 9 callersFunctionprint_test_header
(title: &str)
tests/integration_test.rs:69
↓ 8 callersMethodadd
(&mut self, order: &BookOrder)
src/matching/depth.rs:16
↓ 6 callersFunctionnew_done_log
( log_seq: u64, product_id: &str, order: &BookOrder, remaining_size: &Decimal, reason: &Do
src/matching/log.rs:126
↓ 5 callersMethodput
Adds an order to the time window. Returns error if: - The order timestamp is older than min_time (expired) - The order already exists in the window (d
src/utils/time_window.rs:131
↓ 4 callersFunctioncurrent_time_since_snowflake_epoch
Get current time in milliseconds relative to Snowflake epoch. This is used for time-based deduplication window. Returns: (Unix timestamp ms) - SNOWFLA
src/matching/order_book.rs:32
↓ 4 callersFunctionmake_book_order
(order_id: u64, size: &str, price: &str)
src/matching/depth.rs:70
↓ 3 callersMethodextract_timestamp
Extracts the timestamp from a Snowflake ID. Snowflake ID structure: | 1bit sign | 41bit timestamp(ms) | 10bit node | 12bit sequence |
src/utils/time_window.rs:123
↓ 3 callersMethodlen
(&self)
src/utils/bitmap.rs:21
↓ 3 callersMethodput
(&mut self, val: u64)
src/utils/window.rs:24
↓ 2 callersMethodcleanup
Removes expired orders based on current time. This should be called periodically to prevent memory leaks when there are no new orders.
src/utils/time_window.rs:175
↓ 2 callersMethodcmp
(&self, other: &Self)
src/matching/ordering.rs:40
↓ 2 callersFunctionnew_match_log
( log_seq: u64, product_id: &str, trade_seq: u64, taker_order: &BookOrder, maker_order: &B
src/matching/log.rs:184
↓ 2 callersMethodnext_trade_seq
(&mut self)
src/matching/order_book.rs:630
↓ 2 callersMethodremove_expired_internal
Removes all orders with timestamp < min_time.
src/utils/time_window.rs:202
↓ 1 callersMethodcmp
(&self, other: &Self)
src/utils/time_window.rs:59
↓ 1 callersFunctioncreate_producer
()
tests/integration_test.rs:18
↓ 1 callersFunctionextract_timestamp_from_id
(order_id: u64)
src/utils/time_window.rs:26
↓ 1 callersMethodfetch_message
(&mut self)
src/matching/kafka_order.rs:71
↓ 1 callersMethodfetch_order
(&mut self)
src/matching/kafka_order.rs:83
↓ 1 callersMethodget_latest
(&mut self)
src/matching/redis_snapshot.rs:46
↓ 1 callersFunctioninit_log
(level: &str)
src/main.rs:18
↓ 1 callersFunctionnew_kafka_consumer
( brokers: &[String], group_id: &str, topic: &str, session_time_out: u64, )
src/utils/kafka.rs:29
↓ 1 callersFunctionnew_kafka_producer
( brokers: &[String], message_time_out: u64, )
src/utils/kafka.rs:12
↓ 1 callersFunctionnew_open_log
(log_seq: u64, product_id: &str, taker_order: &BookOrder)
src/matching/log.rs:79
↓ 1 callersFunctionnew_redis_client
(ip: &str, port: u16)
src/utils/redis.rs:3
↓ 1 callersFunctionnormalize_price
Normalize price to the specified scale using rounding (matches Go version's Round behavior)
src/matching/order_book.rs:20
↓ 1 callersFunctionnormalize_size
Normalize size to the specified scale using rounding (matches Go version's Round behavior)
src/matching/order_book.rs:25
↓ 1 callersFunctionprint_done_log
(log: &Value, offset: i64)
tests/log_verifier.rs:116
↓ 1 callersFunctionprint_match_log
(log: &Value, offset: i64)
tests/log_verifier.rs:96
↓ 1 callersFunctionprint_open_log
(log: &Value, offset: i64)
tests/log_verifier.rs:107
↓ 1 callersFunctionread_config
()
src/config.rs:36
↓ 1 callersMethodrestore
(&mut self, snapshot: &Snapshot)
src/matching/engine.rs:99
↓ 1 callersMethodset_offset
(&mut self, offset: Offset)
src/matching/kafka_order.rs:38
↓ 1 callersMethodstart
( &mut self, snapshot_store: &mut RedisSnapshotStore, order_reader: &mut KafkaOrderRea
src/matching/engine.rs:54
Methodapply_order
(&mut self, order: &Order)
src/matching/order_book.rs:257
Methodcancel_order
(&mut self, order: &Order)
src/matching/order_book.rs:503
Methodcleanup_time_window
Cleanup expired orders from the time window. This should be called periodically to prevent memory leaks when there are no new orders.
src/matching/order_book.rs:620
Methodcontains
(&self, val: u64)
src/utils/window.rs:53
Methodcontains
Checks if an order exists in the window.
src/utils/time_window.rs:192
Methoddefault
()
src/utils/time_window.rs:95
Methoddefault
()
src/matching/order_book.rs:58
Functiondeserialize_done_reason
(deserializer: D)
src/models/types.rs:171
Functiondeserialize_log_type
(deserializer: D)
src/matching/log.rs:29
Functiondeserialize_order_status
(deserializer: D)
src/models/types.rs:138
Functiondeserialize_order_type
(deserializer: D)
src/models/types.rs:20
Functiondeserialize_side
(deserializer: D)
src/models/types.rs:58
Functiondeserialize_time_in_force_type
(deserializer: D)
src/models/types.rs:94
Methodeq
(&self, other: &Self)
src/matching/ordering.rs:28
Functionextract_node_id_from_id
(order_id: u64)
src/utils/time_window.rs:33
Methodfmt
(&self, f: &mut fmt::Formatter)
src/utils/error.rs:18
Methodfrom_string
(s: String)
src/utils/error.rs:12
Methodget_bit
(byte: u8, bit_idx: u64)
src/utils/bitmap.rs:49
Methodget_seq
(&self)
src/matching/log.rs:74
Functionget_table_index_by_order_id
Returns the table shard index for a given order ID. This uses the node ID embedded in the Snowflake ID to determine the shard. The formula: (order_id
src/utils/time_window.rs:40
Functionget_table_index_by_user_id
Returns the table shard index for a given user ID. The user ID is directly used for sharding to ensure consistent routing.
src/utils/time_window.rs:46
Methodis_order_will_full_match
(&self, order: &Order)
src/matching/order_book.rs:169
Methodis_order_will_not_match
(&self, order: &Order)
src/matching/order_book.rs:129
Functionmain
()
src/main.rs:35
Functionmain
()
tests/integration_test.rs:76
Functionmain
()
tests/log_verifier.rs:10
Methodnew
(min: u64, max: u64)
src/utils/window.rs:15
Methodnew
Creates a new time-based deduplication window.
src/utils/time_window.rs:102
Methodnew
(l: u64)
src/utils/bitmap.rs:14
Methodnew
(e: &dyn Error)
src/utils/error.rs:8
Methodnew
(price: &Decimal, order_id: u64)
src/matching/ordering.rs:17
Methodnew
(product: &Product, snapshot_store: &mut RedisSnapshotStore)
src/matching/engine.rs:36
Methodnew_book_order
(order: &Order)
src/matching/order_book.rs:73
Methodnew_kafka_log_producer
( brokers: &[String], product_id: &str, message_time_out: u64, )
src/matching/kafka_log.rs:19
Methodnew_kafka_order_consumer
( brokers: &[String], group_id: &str, product_id: &str, session_time_out: u64,
src/matching/kafka_order.rs:22
Methodnew_order_book
(product: &Product)
src/matching/order_book.rs:110
Methodnew_redis_snapshot_store
( product_id: &str, ip: &str, port: u16, )
src/matching/redis_snapshot.rs:18
Methodnullify_order
(&mut self, order: &Order)
src/matching/order_book.rs:556
Methodopposite
(self)
src/models/types.rs:39
Methodpartial_cmp
(&self, other: &Self)
src/utils/time_window.rs:69
Methodpartial_cmp
(&self, other: &Self)
src/matching/ordering.rs:34
Methodrestore
Restores the window from a snapshot. Note: epoch is ignored since it's always SNOWFLAKE_EPOCH.
src/utils/time_window.rs:228
Methodrestore
(&mut self, snapshot: &OrderBookSnapshot)
src/matching/order_book.rs:598
Methodrun_applier
( &mut self, order_rx: Receiver<OffsetOrder>, log_tx: Sender<Box<dyn LogTrait>>,
src/matching/engine.rs:145
Methodrun_committer
( log_seq: u64, log_rx: Receiver<Box<dyn LogTrait>>, snapshot_approve_req_rx: Receiver
src/matching/engine.rs:236
Methodrun_fetcher
( order_offset: u64, order_reader: &mut KafkaOrderReader, order_tx: Sender<OffsetOrder
src/matching/engine.rs:105
Methodrun_snapshots
( product_id: &str, order_offset: u64, snapshot_req_tx: Sender<Snapshot>, snap
src/matching/engine.rs:315
Functionserialize_done_reason
(done_reason: &DoneReason, serializer: S)
src/models/types.rs:160
Functionserialize_log_type
(log_type: &LogType, serializer: S)
src/matching/log.rs:17
Functionserialize_order_status
( order_status: &OrderStatus, serializer: S, )
src/models/types.rs:120
Functionserialize_order_type
(order_type: &OrderType, serializer: S)
src/models/types.rs:9
Functionserialize_side
(side: &Side, serializer: S)
src/models/types.rs:47
Functionserialize_time_in_force_type
( time_in_force_type: &TimeInForceType, serializer: S, )
src/models/types.rs:78
Methodset_bit
(byte: u8, bit_idx: u64, v: bool)
src/utils/bitmap.rs:57
Methodsize
Returns the number of orders in the window.
src/utils/time_window.rs:187
Methodsnapshot
Returns a snapshot of the window state for serialization.
src/utils/time_window.rs:217
Methodsnapshot
(&self)
src/matching/order_book.rs:575
Methodstore
(&mut self, snapshot: &Snapshot)
src/matching/redis_snapshot.rs:33
Methodstore
(&self, logs: &[Box<dyn LogTrait>])
src/matching/kafka_log.rs:33
next →1–100 of 115, ranked by callers