Skip to main content

clob_sync/
prelude.rs

1// re-export of public modules
2pub use crate::execution::*;
3pub use crate::order::*;
4pub use crate::order_book::*;
5
6// re-export of error
7pub use crate::error::Error;
8
9/// A specialized `Result` type for order book operations.
10pub type Result<T> = core::result::Result<T, Error>;
11
12/// A generic wrapper tuple struct implementing the newtype pattern.
13///
14/// This is a utility type for creating zero-cost abstractions.
15#[derive(Debug)]
16pub struct W<T>(pub T);
17
18// shortcuts
19pub use std::format as f;
20
21/// Logs an error message and panics with the same message.
22///
23/// # Example
24///
25/// ```text
26/// // Use the macro from the crate root
27/// // fatal!("Something went wrong: {}", "error details");
28/// ```
29#[macro_export]
30macro_rules! fatal {
31    ($($arg:tt)*) => {{
32        ::log::error!($($arg)*);
33        panic!($($arg)*);
34    }};
35}