pub struct EmailWriter<'a> { /* private fields */ }
Expand description

Wrapper around Write that remembers the length of the last line written to it.

Implementations§

Construct a new EmailWriter.

  • line_len is the length of the last line in writer.
  • spaces the number of spaces that must be written before the next write.
  • can_go_to_new_line_now is whether the current line can be wrapped now or not.

Go to a new line and reset the line_len to 0.

Write a space which might get wrapped to a new line on the next write.

Write a space which won’t be printed if the line wraps.

This method shouldn’t be called multiple times consecutively, and will panic if debug assertions are on.

Get the length in bytes of the last line written to the inner writer.

Get the length in bytes of the last line written to the inner writer plus the spaces which might be written to in on the next write call.

Get a Writer which automatically line folds text written to it.

Trait Implementations§

Executes the destructor for this type. Read more
Writes a string slice into this writer, returning whether the write succeeded. Read more
Writes a char into this writer, returning whether the write succeeded. Read more
Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.