literator 0.2.0

Efficient conversion of iterators to human-readable strings
Documentation
//! Adapters for [`Literator`].

#[cfg(doc)]
use crate::Literator;

/// Helper for [`Literator::prefix_each()`].
#[derive(Clone, Copy)]
pub struct Prefix<T, P> {
    /// Item implementing a formatting trait.
    pub item: T,
    /// Displayable prefix.
    pub prefix: P,
}

/// Helper for [`Literator::suffix_each()`].
#[derive(Clone, Copy)]
pub struct Suffix<T, S> {
    /// Item implementing a formatting trait.
    pub item: T,
    /// Displayable suffix.
    pub suffix: S,
}

/// Helper for [`Literator::prefix_each_with()`].
#[derive(Clone, Copy)]
pub struct PrefixWith<T, F> {
    /// Item implementing a formatting trait.
    pub item: T,
    /// Function to call to display the prefix.
    pub with: F,
}

/// Helper for [`Literator::suffix_each_with()`].
#[derive(Clone, Copy)]
pub struct SuffixWith<T, F> {
    /// Item implementing a formatting trait.
    pub item: T,
    /// Function to call to display the suffix.
    pub with: F,
}