pub(crate) struct DisplayIteratorOptions<'a> {
pub(crate) limit: Option<usize>,
pub(crate) separator: &'a str,
pub(crate) left_brace: &'a str,
pub(crate) right_brace: &'a str,
pub(crate) ellipsis: &'a str,
pub(crate) elem_prefix: &'a str,
pub(crate) elem_suffix: &'a str,
pub(crate) show_count: bool,
}
impl Default for DisplayIteratorOptions<'_> {
fn default() -> Self {
Self {
limit: None,
separator: ",",
left_brace: "[",
right_brace: "]",
ellipsis: "..",
elem_prefix: "",
elem_suffix: "",
show_count: false,
}
}
}
impl DisplayIteratorOptions<'_> {
pub(crate) fn limit(&self) -> usize {
self.limit.unwrap_or(5)
}
}