pub struct EncodingBuffer { /* private fields */ }
Expand description

EncodingBuffer for a Mail providing a buffer for encodable traits.

Implementations

Create a new buffer only allowing input compatible with a the specified mail type.

Returns the mail type for which the buffer was created.

returns a new EncodingWriter which contains a mutable reference to the current string buffer

calls the provided function with a EncodingWriter cleaning up afterwards

After calling func with the EncodingWriter following cleanup is performed:

  • if func returned an error handle.undo_header() is called, this won’t undo anything before a finish_header() call but will discard partial writes
  • if func succeeded handle.finish_header() is called

writes a body to the internal buffer, without verifying it’s correctness

Error

This can fail if a body does not contain valid utf8.

Converts the internal buffer into an utf-8 string if possible.

Lossy conversion of the internal buffer to an string.

Return a slice view to the underlying buffer.

Trait Implementations

Converts this type into the (usually inferred) input type.
Converts this type into the (usually inferred) input type.

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.