aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-symfony-console/src/formatter/wrappable_output_formatter_interface.rs
blob: 39e6cea12dfb49369bb68bfaa891d5ed5b94983c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
//! ref: composer/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php

use crate::formatter::output_formatter_interface::OutputFormatterInterface;

/// Formatter interface for console output that supports word wrapping.
pub trait WrappableOutputFormatterInterface: OutputFormatterInterface {
    /// Formats a message according to the given styles, wrapping at `width` (0 means no wrapping).
    fn format_and_wrap(
        &mut self,
        message: Option<&str>,
        width: i64,
    ) -> anyhow::Result<Option<String>>;
}