hydra/
gen_server_options.rs1use std::time::Duration;
2
3#[derive(Debug, Default, Clone)]
5pub struct GenServerOptions {
6 pub(crate) name: Option<String>,
7 pub(crate) timeout: Option<Duration>,
8}
9
10impl GenServerOptions {
11 pub const fn new() -> Self {
13 Self {
14 name: None,
15 timeout: None,
16 }
17 }
18
19 pub fn name<T: Into<String>>(mut self, name: T) -> Self {
21 self.name = Some(name.into());
22 self
23 }
24
25 pub fn timeout(mut self, timeout: Duration) -> Self {
27 self.timeout = Some(timeout);
28 self
29 }
30}