Trait pretty_trait::JoinExt [] [src]

pub trait JoinExt: Sized {
    fn join<U>(self, other: U) -> Join<Self, U>;
}

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

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!"
);

Implementors