Struct new_tokio_smtp::io::Io

source ·
pub struct Io { /* private fields */ }
Expand description

A Io object representing a smtp connection with buffers, socket and ehlo data

Implementations§

return a futures resolving back to this instance once all output data is flushed

writes cmd and then "\r\n" to buffer.input and then calls flush

writes data from the output buffer to the socket and polls flush

This first poll the writing of data from output to socket until output is empty, then it will start polling flush on the socket.

parse a “normal” smtp response

Panics

Panics if the write buffer is not empty

read data from the socket to buffer.input until it would block or the socket closed

The input buffer is increased in increments of 256 bytes (INPUT_BUFFER_INC_SIZE)

Implementation Limitations

Be aware that try_read_line does only work on continuous buffers. I.e. it would fail if self.in_buffer() is a Chain

write all data from source to the output socket using dot-stashing

This includes the end of message sequence “\r\n.\r\n”, through this implementation makes sure not to add a additional “\r\n” to the end of the file if it isn’t needed.

create a new Tcp only connection to the given address

create a new Tcp-Tls connection to the given address using the given tls config

split this instance into it’s parts

writes all strings in parts to the output buffer followed by "\r\n"

returns a &mut to the inner Socket abstraction

returns a & to the inner Socket abstraction

true if the socket uses Tls

(can also be true in case of a mock socket)

returns a &mut to a (the) output buffer having at last need_rem bytes free capacity

returns a &mut to the input buffer

access the stored ehlo data

store different helo data

checks if a specific EsmtpKeyword had been in the last Ehlo response

used to impl. simple commands e.g. con.send_simple_cmd(&["NOOP"])

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.

create a new Connection from a Io instance

The Io instance should contain a Socket which is still alive.

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the 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.