batch_mode_token_expansion_traits/
system_message_traits.rs

1// ---------------- [ File: batch-mode-token-expansion-traits/src/system_message_traits.rs ]
2crate::ix!();
3
4/// A trait that describes the system message goal for a given axis set.
5/// This is typically implemented for the entire enum and returns a single,
6/// static system message goal string for the entire type.
7pub trait SystemMessageGoal {
8    /// Returns the system message goal associated with the entire enum.
9    fn system_message_goal(&self) -> Cow<'_,str>;
10}
11
12#[derive(Debug,Clone,PartialEq,Eq)]
13pub struct SystemMessageHeader {
14    content: String,
15}
16
17impl SystemMessageHeader {
18
19    pub fn new(x: &str) -> Self { Self { content: x.to_string() } }
20
21    pub fn get(&self) -> &str {
22        &self.content
23    }
24}
25
26impl std::fmt::Display for SystemMessageHeader {
27
28    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29        write!(f, "{}", self.get())
30    }
31}