pub trait SliceConcatExt<T> where T: ?Sized, { type Output; fn concat(&self) -> Self::Output; fn join(&self, sep: &T) -> Self::Output; fn connect(&self, sep: &T) -> Self::Output { ... } }
An extension trait for concatenating slices
While this trait is unstable, the methods are stable. SliceConcatExt
is included in the standard library prelude, so you can use join()
and concat()
as if they existed on [T]
itself.
type Output
The resulting type after concatenation
fn concat(&self) -> Self::Output
1.0.0
Flattens a slice of T
into a single value Self::Output
.
fn join(&self, sep: &T) -> Self::Output
1.3.0
impl<S> SliceConcatExt<str> for [S] where
S: Borrow<str>,
[src]
type Output = String
fn concat(&self) -> String
[src]
fn join(&self, sep: &str) -> String
[src]
impl<T, V> SliceConcatExt<T> for [V] where
T: Clone,
V: Borrow<[T]>,
[src]
© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/slice/trait.SliceConcatExt.html