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
type OutputThe resulting type after concatenation
fn concat(&self) -> Self::OutputFlattens a slice of T into a single value Self::Output.
assert_eq!(["hello", "world"].concat(), "helloworld");
fn join(&self, sep: &T) -> Self::OutputFlattens a slice of T into a single value Self::Output, placing a given separator between each.
assert_eq!(["hello", "world"].join(" "), "hello world"); fn connect(&self, sep: &T) -> Self::Outputimpl<T, V> SliceConcatExt<T> for [V] where T: Clone, V: Borrow<[T]>impl<S> SliceConcatExt<str> for [S] where S: Borrow<str>
© 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