[][src]Struct justify::Settings

pub struct Settings<'a> {
    pub justify_last_line: bool,
    pub hyphenate_overflow: bool,
    pub width: usize,
    pub insert_at: InsertAt<'a>,
    pub ignore_spaces: bool,
    pub newline: &'a str,
    pub hyphen: &'a str,
    pub separator: &'a str,
}

Settings used by justify and justify_paragraph

Fields

justify_last_line: bool

Whether the last line should also be justified. Can result in weird output if the last line contains very few words.

hyphenate_overflow: bool

Hyphenate if a word is longer than self.width

width: usize

Width (in codepoints)

insert_at: InsertAt<'a>

In a given line, the pattern spaces should be inserted at.

ignore_spaces: bool

This feature is sometimes useful with CJK text in conjunction with hyphenate_overflow. When on, spaces are not considered when justifying text.

newline: &'a str

The string that should be used to separate lines. Perhaps useful on Windows where you might want "\r\n" instead.

hyphen: &'a str

The hyphen that should be used if hyphenate_overflow is true

separator: &'a str

The separator between paragraphs when justify is called

Trait Implementations

impl<'a> Default for Settings<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Settings<'a>

impl<'a> !Send for Settings<'a>

impl<'a> !Sync for Settings<'a>

impl<'a> Unpin for Settings<'a>

impl<'a> !UnwindSafe for Settings<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.