pub struct Join<U, Iterator: IntoIterator<Item = U>> {
pub iterator: Iterator,
pub joiner: &'static str,
}
Equivalent to Each()
, but inserts a joiner between two adjacent elements.
struct Point(i32, i32);
let items = vec![Point(10, 20), Point(5, 10), Point(6, 42)];
let document = Document::with(Join(
(&items, ", "),
|item, doc| doc.add("Point(").add(item.0).add(",").add(item.1).add(")")
));
assert_eq!(document.to_string()?, "Point(10,20), Point(5,10), Point(6,42)");
impl<U, Iterator> Send for Join<U, Iterator> where Iterator: Send, | |
impl<U, Iterator> Sync for Join<U, Iterator> where Iterator: Sync, | |
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)