rformat 0.2.0

Runtime formatting library
Documentation
/// Formatting engine and traits for custom formatting.
pub mod format;

// Internal formatting helpers for low-level formatting operations.
mod violence;

/// Trait for implementing custom formatting for user types.
///
/// Implement this trait to provide custom formatting logic for your type.
pub trait Custom {
    /// Format the value using the provided format specification.
    ///
    /// # Arguments
    ///
    /// * `format_spec` - The parsed format specification
    /// * `precision` - Optional precision value
    /// * `width` - The width to format to
    /// * `parameter` - The parameter being formatted
    ///
    /// # Returns
    ///
    /// A `Result` containing the formatted string or an error
    fn format(&self,
        format_spec: &crate::format_spec::FormatSpec,
        precision: Option<usize>,
        width: usize,
        parameter: &format::Parameter,
    ) -> crate::error::Result<String>;
}