asimov_patterns/programs/
prompter.rs1use crate::Execute;
4use alloc::{string::String, vec::Vec};
5use bon::Builder;
6
7pub trait Prompter<T, E>: Execute<T, E> {}
11
12#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Builder)]
27#[builder(derive(Debug), on(String, into))]
28pub struct PrompterOptions {
29 #[builder(field)]
31 pub other: Vec<String>,
32
33 pub input: Option<String>,
35
36 pub model: Option<String>,
38
39 pub output: Option<String>,
41}
42
43impl<S: prompter_options_builder::State> PrompterOptionsBuilder<S> {
44 pub fn other(mut self, flag: impl Into<String>) -> Self {
45 self.other.push(flag.into());
46 self
47 }
48
49 pub fn maybe_other(mut self, flag: Option<impl Into<String>>) -> Self {
50 if let Some(flag) = flag {
51 self.other.push(flag.into());
52 }
53 self
54 }
55}