asimov_patterns/programs/
fetcher.rs1use crate::Execute;
4use alloc::{string::String, vec::Vec};
5use bon::Builder;
6
7pub trait Fetcher<T, E>: Execute<T, E> {}
11
12#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Builder)]
24#[builder(derive(Debug), on(String, into))]
25pub struct FetcherOptions {
26 #[builder(field)]
28 pub other: Vec<String>,
29
30 pub output: Option<String>,
32}
33
34impl<S: fetcher_options_builder::State> FetcherOptionsBuilder<S> {
35 pub fn other(mut self, flag: impl Into<String>) -> Self {
36 self.other.push(flag.into());
37 self
38 }
39
40 pub fn maybe_other(mut self, flag: Option<impl Into<String>>) -> Self {
41 if let Some(flag) = flag {
42 self.other.push(flag.into());
43 }
44 self
45 }
46}