Skip to main content

StringIterable

Trait StringIterable 

Source
pub trait StringIterable {
    // Required method
    fn to_string_vec(&self) -> Vec<String>;
}
Expand description

Trait for converting an iterable of items that can be displayed into a vector of strings

Required Methods§

Source

fn to_string_vec(&self) -> Vec<String>

Converts the iterable to a vector of strings.

§Example
use handy::iter::StringIterable;

let x = vec![1, 2, 3];
let y = x.to_string_vec();
assert_eq!(y, vec!["1", "2", "3"]);

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> StringIterable for Option<Vec<T>>
where T: Display,

Source§

impl<T> StringIterable for Vec<T>
where T: Display,

Source§

impl<T> StringIterable for [T]
where T: Display,

Implementors§