Skip to content

Commit a981ae4

Browse files
committed
Update Rust docs
1 parent 9751400 commit a981ae4

File tree

119 files changed

+171
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+171
-37
lines changed

nautilus_core/accounting/src/account/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub struct BaseAccount {
4444
}
4545

4646
impl BaseAccount {
47+
/// Creates a new [`BaseAccount`] instance.
4748
pub fn new(event: AccountState, calculate_account_state: bool) -> anyhow::Result<Self> {
4849
let mut balances_starting: HashMap<Currency, Money> = HashMap::new();
4950
let mut balances: HashMap<Currency, AccountBalance> = HashMap::new();

nautilus_core/accounting/src/account/cash.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ pub struct CashAccount {
4343
}
4444

4545
impl CashAccount {
46+
/// Creates a new [`CashAccount`] instance.
4647
pub fn new(event: AccountState, calculate_account_state: bool) -> anyhow::Result<Self> {
4748
Ok(Self {
4849
base: BaseAccount::new(event, calculate_account_state)?,

nautilus_core/accounting/src/account/margin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ pub struct MarginAccount {
5454
}
5555

5656
impl MarginAccount {
57+
/// Creates a new [`MarginAccount`] instance.
5758
pub fn new(event: AccountState, calculate_account_state: bool) -> anyhow::Result<Self> {
5859
Ok(Self {
5960
base: BaseAccount::new(event, calculate_account_state)?,

nautilus_core/adapters/src/databento/live.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub struct DatabentoFeedHandler {
8383
}
8484

8585
impl DatabentoFeedHandler {
86-
/// Initialize a new instance of the [`DatabentoFeedHandler`].
86+
/// Creates a new [`DatabentoFeedHandler`] instance.
8787
#[must_use]
8888
pub fn new(
8989
key: String,

nautilus_core/adapters/src/databento/loader.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ pub struct DatabentoDataLoader {
6868
}
6969

7070
impl DatabentoDataLoader {
71+
/// Creates a new [`DatabentoDataLoader`] instance.
7172
pub fn new(path: Option<PathBuf>) -> anyhow::Result<Self> {
7273
let mut loader = Self {
7374
publishers_map: IndexMap::new(),

nautilus_core/adapters/src/databento/types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ pub struct DatabentoImbalance {
8585
}
8686

8787
impl DatabentoImbalance {
88+
/// Creates a new [`DatabentoImbalance`] instance.
8889
#[allow(clippy::too_many_arguments)]
8990
pub fn new(
9091
instrument_id: InstrumentId,
@@ -154,6 +155,7 @@ pub struct DatabentoStatistics {
154155
}
155156

156157
impl DatabentoStatistics {
158+
/// Creates a new [`DatabentoStatistics`] instance.
157159
#[allow(clippy::too_many_arguments)]
158160
pub fn new(
159161
instrument_id: InstrumentId,

nautilus_core/backtest/src/engine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct TimeEventAccumulator {
2929
}
3030

3131
impl TimeEventAccumulator {
32-
/// Creates a new `TimeEventAccumulator` instance.
32+
/// Creates a new [`TimeEventAccumulator`] instance.
3333
#[must_use]
3434
pub fn new() -> Self {
3535
Self {
@@ -55,6 +55,7 @@ impl TimeEventAccumulator {
5555
}
5656

5757
impl Default for TimeEventAccumulator {
58+
/// Creates a new default [`TimeEventAccumulator`] instance.
5859
fn default() -> Self {
5960
Self::new()
6061
}

nautilus_core/backtest/src/matching_engine.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ pub struct OrderMatchingEngine {
9191
execution_count: usize,
9292
}
9393

94-
// Note: we'll probably be changing the `FillModel` (don't add for now)
94+
// TODO: we'll probably be changing the `FillModel` (don't add for now)
9595
impl OrderMatchingEngine {
96+
/// Creates a new [`OrderMatchingEngine`] instance.
9697
#[allow(clippy::too_many_arguments)]
9798
pub fn new(
9899
instrument: Box<dyn Instrument>,

nautilus_core/common/src/cache/core.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ pub struct CacheConfig {
6464
}
6565

6666
impl CacheConfig {
67+
/// Creates a new [`CacheConfig`] instance.
6768
#[allow(clippy::too_many_arguments)]
6869
#[must_use]
6970
pub fn new(
@@ -90,7 +91,7 @@ impl CacheConfig {
9091
}
9192

9293
impl Default for CacheConfig {
93-
/// Creates a new default `CacheConfig` instance.
94+
/// Creates a new default [`CacheConfig`] instance.
9495
fn default() -> Self {
9596
Self::new(
9697
SerializationEncoding::MsgPack,
@@ -192,14 +193,14 @@ pub struct Cache {
192193
}
193194

194195
impl Default for Cache {
195-
/// Creates a new default `Cache` instance.
196+
/// Creates a new default [`Cache`] instance.
196197
fn default() -> Self {
197198
Self::new(CacheConfig::default(), None)
198199
}
199200
}
200201

201202
impl Cache {
202-
/// Creates a new `Cache` instance.
203+
/// Creates a new [`Cache`] instance.
203204
#[must_use]
204205
pub fn new(config: CacheConfig, database: Option<CacheDatabaseAdapter>) -> Self {
205206
let index = CacheIndex {

nautilus_core/common/src/cache/database.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub struct DatabaseCommand {
5858
}
5959

6060
impl DatabaseCommand {
61+
/// Creates a new [`DatabaseCommand`] instance.
6162
#[must_use]
6263
pub fn new(op_type: DatabaseOperation, key: String, payload: Option<Vec<Vec<u8>>>) -> Self {
6364
Self {

0 commit comments

Comments
 (0)