-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ac07d2f
commit 5ecf948
Showing
5 changed files
with
120 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/// Configuration for the | ||
#[derive(Clone, Copy)] | ||
pub struct Config { | ||
pub phase1_timeout_secs: u64, | ||
pub phase2_timeout_secs: u64, | ||
pub min_bid_u64: u64, | ||
pub max_strikes: u64, | ||
} | ||
|
||
impl Default for Config { | ||
fn default() -> Self { | ||
Self { | ||
phase1_timeout_secs: 12 * 60, | ||
phase2_timeout_secs: 8 * 60, | ||
min_bid_u64: 1, | ||
max_strikes: 3, | ||
} | ||
} | ||
} | ||
|
||
impl Config { | ||
pub fn with_phase1_timeout_secs(mut self, x: Option<u64>) -> Self { | ||
if let Some(x) = x { | ||
self.phase1_timeout_secs = x; | ||
} | ||
self | ||
} | ||
|
||
pub fn with_phase2_timeout_secs(mut self, x: Option<u64>) -> Self { | ||
if let Some(x) = x { | ||
self.phase2_timeout_secs = x; | ||
} | ||
self | ||
} | ||
|
||
pub fn with_min_bid_u64(mut self, x: Option<u64>) -> Self { | ||
if let Some(x) = x { | ||
self.min_bid_u64 = x; | ||
} | ||
self | ||
} | ||
|
||
pub fn with_max_strikes(mut self, x: Option<u64>) -> Self { | ||
if let Some(x) = x { | ||
self.max_strikes = x; | ||
} | ||
self | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters