simploxide_api_types/
utils.rs

1pub trait CommandSyntax {
2    /// Generate a SimpleX command string from self
3    fn interpret(&self) -> String;
4}
5
6// TODO: This is a workaround for some syntaxes that don't use optional values in square brackets.
7impl<T: CommandSyntax> CommandSyntax for Option<T> {
8    fn interpret(&self) -> String {
9        match self {
10            Some(c) => c.interpret(),
11            None => String::new(),
12        }
13    }
14}