pub trait ActionSummary: Action {
// Provided method
fn summary(&self) -> String { ... }
}Expand description
Trait for actions that provide a summary representation for logging
The default implementation uses the Debug representation. Override
summary() to provide concise summaries for actions with large payloads
(e.g., showing byte counts instead of full data).
§Example
ⓘ
impl ActionSummary for MyAction {
fn summary(&self) -> String {
match self {
MyAction::DidLoadData { data } => {
format!("DidLoadData {{ bytes: {} }}", data.len())
}
_ => format!("{:?}", self)
}
}
}Provided Methods§
Sourcefn summary(&self) -> String
fn summary(&self) -> String
Get a summary representation of this action for logging
Should return a concise string, ideally one line, suitable for display in a scrolling action log. For actions with large data payloads, show size/count summaries instead of full content.
Default implementation uses Debug formatting.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.