[][src]Enum justify::InsertAt

pub enum InsertAt<'a> {
    Left,
    Right,
    Balanced,
    Custom(&'a dyn Fn(usize, usize, usize, &Vec<&str>) -> usize),
}

Where to insert spaces (use with Settings)

Variants

Left

Spaces are added starting at the left.

Right

Spaces are added starting at the right.

Balanced

Default; e.g. if there are 5 places spaced could be added, the first space goes in place 1, the second space in place 5, the third space in place 2, fourth space in place 4, etc.

Custom(&'a dyn Fn(usize, usize, usize, &Vec<&str>) -> usize)

The function receives the current 0-indexed iteration in position 1, the total number of spaces to be added in position 2, the number of possible entry points in position 3, and the line being justified in position 4. This could be used, for example, to implement insertion of spaces at random points. If using this, you may not need every argument, but they are provided anyway for maximum extensibility.

Auto Trait Implementations

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

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

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

impl<'a> Unpin for InsertAt<'a>

impl<'a> !UnwindSafe for InsertAt<'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.