pub struct Join<U, Iterator>where
Iterator: IntoIterator<Item = U>,{
pub iterator: Iterator,
pub joiner: &'static str,
}
Expand description
Equivalent to Each()
, but inserts a joiner between two adjacent elements.
§Example
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)");
Fields§
§iterator: Iterator
§joiner: &'static str
Trait Implementations§
Source§impl<'item, U, Iterator> IterBlockComponent for Join<U, Iterator>where
Iterator: IntoIterator<Item = U>,
impl<'item, U, Iterator> IterBlockComponent for Join<U, Iterator>where
Iterator: IntoIterator<Item = U>,
Auto Trait Implementations§
impl<U, Iterator> Freeze for Join<U, Iterator>where
Iterator: Freeze,
impl<U, Iterator> RefUnwindSafe for Join<U, Iterator>where
Iterator: RefUnwindSafe,
impl<U, Iterator> Send for Join<U, Iterator>where
Iterator: Send,
impl<U, Iterator> Sync for Join<U, Iterator>where
Iterator: Sync,
impl<U, Iterator> Unpin for Join<U, Iterator>where
Iterator: Unpin,
impl<U, Iterator> UnwindSafe for Join<U, Iterator>where
Iterator: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more