pub struct Response<C: ShellConfig> {
pub message: String<256>,
pub inline_message: bool,
pub prefix_newline: bool,
pub indent_message: bool,
pub postfix_newline: bool,
pub show_prompt: bool,
pub exclude_from_history: bool,
/* private fields */
}Expand description
Command execution response with message and formatting flags.
Command failures return Err(CliError::CommandFailed(msg)), not Response.
Fields§
§message: String<256>Response message (uses C::MAX_RESPONSE buffer size)
inline_message: boolMessage is inline (don’t echo newline after command input)
prefix_newline: boolAdd newline before message (in response formatter)
indent_message: boolIndent output (2 spaces)
postfix_newline: boolAdd newline after message
show_prompt: boolDisplay prompt after response
exclude_from_history: boolPrevent input from being saved to history
Implementations§
Source§impl<C: ShellConfig> Response<C>
impl<C: ShellConfig> Response<C>
Sourcepub fn success(message: &str) -> Self
pub fn success(message: &str) -> Self
Create success response with default formatting.
Default: include in history, show prompt, add postfix newline.
Sourcepub fn success_no_history(message: &str) -> Self
pub fn success_no_history(message: &str) -> Self
Create success response that excludes input from history.
Use for commands handling sensitive data (passwords, credentials).
Sourcepub fn without_history(self) -> Self
pub fn without_history(self) -> Self
Builder method to exclude command from history (chainable).
Sourcepub fn inline(self) -> Self
pub fn inline(self) -> Self
Builder method for inline response (appears on same line as command).
Sourcepub fn with_prefix_newline(self) -> Self
pub fn with_prefix_newline(self) -> Self
Builder method to add blank line before response.
Sourcepub fn without_postfix_newline(self) -> Self
pub fn without_postfix_newline(self) -> Self
Builder method to suppress newline after response.
Sourcepub fn without_prompt(self) -> Self
pub fn without_prompt(self) -> Self
Builder method to suppress prompt after response.