asimov_patterns/programs/
cataloger.rs1use crate::Execute;
4use alloc::{string::String, vec::Vec};
5use bon::Builder;
6
7pub trait Cataloger<T, E>: Execute<T, E> {}
11
12#[derive(Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd, Builder)]
25#[builder(derive(Debug), on(String, into))]
26pub struct CatalogerOptions {
27 #[builder(field)]
29 pub other: Vec<String>,
30
31 pub limit: Option<usize>,
33
34 pub output: Option<String>,
36}
37
38impl<S: cataloger_options_builder::State> CatalogerOptionsBuilder<S> {
39 pub fn other(mut self, flag: impl Into<String>) -> Self {
40 self.other.push(flag.into());
41 self
42 }
43
44 pub fn maybe_other(mut self, flag: Option<impl Into<String>>) -> Self {
45 if let Some(flag) = flag {
46 self.other.push(flag.into());
47 }
48 self
49 }
50}