pub struct RtOptions<'a> {
pub width: usize,
pub line_ending: LineEnding,
pub initial_indent: Line<'a>,
pub subsequent_indent: Line<'a>,
pub break_words: bool,
pub wrap_algorithm: WrapAlgorithm,
pub word_separator: WordSeparator,
pub word_splitter: WordSplitter,
}Fields§
§width: usizeThe width in columns at which the text will be wrapped.
line_ending: LineEndingLine ending used for breaking lines.
initial_indent: Line<'a>Indentation used for the first line of output. See the
Options::initial_indent method.
subsequent_indent: Line<'a>Indentation used for subsequent lines of output. See the
Options::subsequent_indent method.
break_words: boolAllow long words to be broken if they cannot fit on a line.
When set to false, some lines may be longer than
self.width. See the Options::break_words method.
wrap_algorithm: WrapAlgorithmWrapping algorithm to use, see the implementations of the
[WrapAlgorithm] trait for details.
word_separator: WordSeparatorThe line breaking algorithm to use, see the WordSeparator
trait for an overview and possible implementations.
word_splitter: WordSplitterThe method for splitting words. This can be used to prohibit splitting words on hyphens, or it can be used to implement language-aware machine hyphenation.
Implementations§
Source§impl<'a> RtOptions<'a>
impl<'a> RtOptions<'a>
pub fn new(width: usize) -> Self
pub fn line_ending(self, line_ending: LineEnding) -> Self
pub fn width(self, width: usize) -> Self
pub fn initial_indent(self, initial_indent: Line<'a>) -> Self
pub fn subsequent_indent(self, subsequent_indent: Line<'a>) -> Self
pub fn break_words(self, break_words: bool) -> Self
pub fn word_separator(self, word_separator: WordSeparator) -> RtOptions<'a>
pub fn wrap_algorithm(self, wrap_algorithm: WrapAlgorithm) -> RtOptions<'a>
pub fn word_splitter(self, word_splitter: WordSplitter) -> RtOptions<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for RtOptions<'a>
impl<'a> RefUnwindSafe for RtOptions<'a>
impl<'a> Send for RtOptions<'a>
impl<'a> Sync for RtOptions<'a>
impl<'a> Unpin for RtOptions<'a>
impl<'a> UnsafeUnpin for RtOptions<'a>
impl<'a> UnwindSafe for RtOptions<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more