pub struct ExecutorBuilder {
pub config_path: Option<String>,
pub config_format: Option<ConfigFormat>,
pub ns3_path: Option<String>,
pub task_concurrent: Option<usize>,
pub retry_limit: Option<u32>,
}
Fields§
§config_path: Option<String>
§config_format: Option<ConfigFormat>
§ns3_path: Option<String>
§task_concurrent: Option<usize>
§retry_limit: Option<u32>
Implementations§
Source§impl ExecutorBuilder
impl ExecutorBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/simple.rs (line 67)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Sourcepub fn config_path(self, config_path: &str) -> Self
pub fn config_path(self, config_path: &str) -> Self
Examples found in repository?
examples/simple.rs (line 68)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Sourcepub fn config_format(self, config_format: ConfigFormat) -> Self
pub fn config_format(self, config_format: ConfigFormat) -> Self
Examples found in repository?
examples/simple.rs (line 69)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Sourcepub fn ns3_path(self, ns3_path: &str) -> Self
pub fn ns3_path(self, ns3_path: &str) -> Self
Examples found in repository?
examples/simple.rs (line 70)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Sourcepub fn task_concurrent(self, task_concurrent: usize) -> Self
pub fn task_concurrent(self, task_concurrent: usize) -> Self
Examples found in repository?
examples/simple.rs (line 93)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Sourcepub fn retry_limit(self, retry_limit: u32) -> Self
pub fn retry_limit(self, retry_limit: u32) -> Self
Examples found in repository?
examples/simple.rs (line 94)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Sourcepub fn build<T: Default + BuildParam<P> + DeserializeOwned, P: BuildCmd>(
self,
) -> Result<Executor<T, P>, Error>
pub fn build<T: Default + BuildParam<P> + DeserializeOwned, P: BuildCmd>( self, ) -> Result<Executor<T, P>, Error>
Examples found in repository?
examples/simple.rs (line 71)
64async fn main() {
65 // ========== Use toml format as the config file ==========
66 // Use ExecutorBuilder to build your executor.
67 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
68 .config_path("config.toml")
69 .config_format(ConfigFormat::Toml)
70 .ns3_path("ns-allinone-3.33/ns-3.33/")
71 .build()
72 .unwrap();
73
74 // Run your executor.
75 let _ = exe.execute().await.unwrap();
76
77 // Collect your results.
78 let outputs = exe.get_outputs().to_owned();
79
80 // Here I just print all the results, you can do whatever you want with them here.
81 for (_, output) in outputs {
82 for task in output {
83 println!("{}", task.stderr);
84 }
85 }
86
87 // ========== Use ron format as the config file ==========
88 // Use ExecutorBuilder to build your executor.
89 let mut exe: Executor<MyConfig, MyParam> = ExecutorBuilder::new()
90 .config_path("config.ron")
91 .config_format(ConfigFormat::Ron)
92 .ns3_path("ns-allinone-3.33/ns-3.33/")
93 .task_concurrent(4)
94 .retry_limit(2)
95 .build()
96 .unwrap();
97
98 // Run your executor.
99 let _ = exe.execute().await.unwrap();
100
101 // Collect your results.
102 let outputs = exe.get_outputs().to_owned();
103
104 // Here I just print all the results, you can do whatever you want with them here.
105 for (_, output) in outputs {
106 for task in output {
107 println!("{}", task.stderr);
108 }
109 }
110}
Trait Implementations§
Source§impl Clone for ExecutorBuilder
impl Clone for ExecutorBuilder
Source§fn clone(&self) -> ExecutorBuilder
fn clone(&self) -> ExecutorBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExecutorBuilder
impl Debug for ExecutorBuilder
Auto Trait Implementations§
impl Freeze for ExecutorBuilder
impl RefUnwindSafe for ExecutorBuilder
impl Send for ExecutorBuilder
impl Sync for ExecutorBuilder
impl Unpin for ExecutorBuilder
impl UnwindSafe for ExecutorBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more