[−][src]Trait nom::lib::std::slice::SliceConcatExt
🔬 This is a nightly-only experimental API. (slice_concat_ext
)
trait should not have to exist
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.
Associated Types
type Output
🔬 This is a nightly-only experimental API. (slice_concat_ext
)
trait should not have to exist
The resulting type after concatenation
Required Methods
fn concat(&self) -> Self::Output
1.0.0
Flattens a slice of T
into a single value Self::Output
.
Examples
assert_eq!(["hello", "world"].concat(), "helloworld"); assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
fn join(&self, sep: &T) -> Self::Output
1.3.0
Flattens a slice of T
into a single value Self::Output
, placing a
given separator between each.
Examples
assert_eq!(["hello", "world"].join(" "), "hello world"); assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
fn connect(&self, sep: &T) -> Self::Output
1.0.0
Deprecated since 1.3.0
: renamed to join
Implementations on Foreign Types
impl<S> SliceConcatExt<str> for [S] where
S: Borrow<str>,
[src]
impl<S> SliceConcatExt<str> for [S] where
S: Borrow<str>,
type Output = String
🔬 This is a nightly-only experimental API. (slice_concat_ext
)
trait should not have to exist
fn concat(&self) -> String
[src]
fn concat(&self) -> String
fn join(&self, sep: &str) -> String
[src]
fn join(&self, sep: &str) -> String
fn connect(&self, sep: &str) -> String
[src]
fn connect(&self, sep: &str) -> String
Deprecated since 1.3.0
: renamed to join
impl<T, V> SliceConcatExt<T> for [V] where
T: Clone,
V: Borrow<[T]>,
[src]
impl<T, V> SliceConcatExt<T> for [V] where
T: Clone,
V: Borrow<[T]>,
type Output = Vec<T>
🔬 This is a nightly-only experimental API. (slice_concat_ext
)
trait should not have to exist
fn concat(&self) -> Vec<T>
[src]
fn concat(&self) -> Vec<T>
fn join(&self, sep: &T) -> Vec<T>
[src]
fn join(&self, sep: &T) -> Vec<T>
fn connect(&self, sep: &T) -> Vec<T>
[src]
fn connect(&self, sep: &T) -> Vec<T>
Deprecated since 1.3.0
: renamed to join