pub trait JoinExt: Sized {
// Required method
fn join<U>(self, other: U) -> Join<Self, U>;
}Expand description
Allows join to be called on any Pretty type.
This trait is automatically implemented for all Pretty types. It should never be implemented
manually.
Required Methods§
Sourcefn join<U>(self, other: U) -> Join<Self, U>
fn join<U>(self, other: U) -> Join<Self, U>
Concatenate two pretty-printable values. This directly displays one after the other, with
no separation or line breaks. For separation, use the Sep type.
§Examples
Basic usage:
use pretty_trait::{JoinExt, to_string};
let max_line = Some(10);
let tab_size = 4;
// Exceeds maximum line length, but does not break because there is no break-point:
assert_eq!(
to_string(&"hello".join("world!"), max_line, tab_size),
"helloworld!"
);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.