pub trait Join {
// Required method
fn write_join<I: Display, W: Write, T: IntoIterator<Item = I>>(
&self,
writer: W,
coll: T,
) -> Result<usize>;
// Provided method
fn join<I: Display, T: IntoIterator<Item = I>>(&self, coll: T) -> String { ... }
}
Expand description
This trait brings the join
and write_join
methods into scope.
Required Methods§
Sourcefn write_join<I: Display, W: Write, T: IntoIterator<Item = I>>(
&self,
writer: W,
coll: T,
) -> Result<usize>
fn write_join<I: Display, W: Write, T: IntoIterator<Item = I>>( &self, writer: W, coll: T, ) -> Result<usize>
Called on the separator, this takes a writer and something that can be turned into an iterator and writes the joined result to the writer.
Provided Methods§
Sourcefn join<I: Display, T: IntoIterator<Item = I>>(&self, coll: T) -> String
fn join<I: Display, T: IntoIterator<Item = I>>(&self, coll: T) -> String
Called on the separator, this takes something that can be turned into an iterator and produces a heap-allocated string
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.