pub trait SepBy: IntoIterator{
// Required methods
fn sep_by<S: Separator + ?Sized>(
self,
sep: &S,
) -> SepBy<'_, Self::IntoIter, S>;
fn sep_by_write_into<S: Separator + ?Sized>(
self,
sep: &S,
) -> SepBy<'_, Self::IntoIter, S>
where Self::Item: WriteInto;
}Expand description
Create a new object using given iterator and separator.
Note that this is a trait, and you can use it with any type that implements IntoIterator and whose IntoIterator::IntoIter implements Clone.
§Examples
use iof::SepBy;
let v = vec![1, 2, 3];
let s = format!("{}", v.sep_by(", "));
assert_eq!(s, "1, 2, 3");Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.