Enum justify::InsertAt
[−]
[src]
pub enum InsertAt<'a> { Left, Right, Balanced, Custom(&'a 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 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.