#[non_exhaustive]pub struct ReportConfig {
pub banner_width: usize,
pub agent_titles: BTreeMap<AgentName, (String, String)>,
}Expand description
Configuration for the report formatter.
Controls banner width and agent display names/titles.
§ASCII Constraint
The fixed-width banner guarantee (banner_width bytes per line) assumes
all displayed content is ASCII. Agent titles, verdict labels, and consensus
strings are ASCII by default. If agent_titles contains multi-byte UTF-8
characters, banner lines will have correct byte length but may appear
visually misaligned in terminals because multi-byte characters can occupy
more than one display column.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.Total width of the ASCII banner in bytes, including border characters (default: 52). Equals character count for ASCII content.
agent_titles: BTreeMap<AgentName, (String, String)>Maps agent name to (display_name, title) for report display. Values should be ASCII for correct banner alignment.
Implementations§
Source§impl ReportConfig
impl ReportConfig
Sourcepub const MIN_BANNER_WIDTH: usize = 8
pub const MIN_BANNER_WIDTH: usize = 8
Minimum banner_width accepted by ReportConfig::new_checked.
Allows | + 6 content bytes + | = 8 bytes minimum for any meaningful banner.
Sourcepub fn new_checked(
banner_width: usize,
agent_titles: BTreeMap<AgentName, (String, String)>,
) -> Result<Self, ReportError>
pub fn new_checked( banner_width: usize, agent_titles: BTreeMap<AgentName, (String, String)>, ) -> Result<Self, ReportError>
Creates a ReportConfig with validated banner_width and ASCII agent_titles.
Returns Err(ReportError::BannerTooSmall) if banner_width < 8.
Returns Err(ReportError::NonAsciiTitle) if any display name or title in
agent_titles contains non-ASCII characters.
This allows fit_content to assume ASCII without run-time panic and
ensures the banner is at least minimally renderable.
§Example
let mut titles = BTreeMap::new();
titles.insert(AgentName::Melchior, ("Melchior".to_string(), "Scientist".to_string()));
let config = ReportConfig::new_checked(52, titles)?;Trait Implementations§
Source§impl Clone for ReportConfig
impl Clone for ReportConfig
Source§fn clone(&self) -> ReportConfig
fn clone(&self) -> ReportConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more