Enum amq_protocol_tcp::TcpStream[][src]

pub enum TcpStream {
    Plain(TcpStreambool),
    NativeTls(Box<TlsStream<TcpStream>, Global>),
}
Expand description

Re-export TcpStream Wrapper around plain or TLS TCP streams

Variants

Plain(TcpStreambool)

Wrapper around mio’s TcpStream

Wrapper around a TLS stream hanled by native-tls

Implementations

Re-export TcpStream

Wrapper around mio’s TcpStream::connect inspired by std::net::TcpStream::connect

Wrapper around mio’s TcpStream::connect inspired by std::net::TcpStream::connect_timeout and std::net::TcpStream::connect. We used the timeout on the first SocketAddr.

Wrapper around mio’s TcpStream::from_std

Check whether the stream is connected or not

Retry the connection. Returns:

  • Ok(true) if connected
  • Ok(false) if connecting
  • Err(_) if an error is encountered

Enable TLS

Enable TLS using native-tls

Re-export TcpStream

Attempt reading from underlying stream, returning Ok(()) if the stream is readable

Attempt writing to underlying stream, returning Ok(()) if the stream is writable

Methods from Deref<Target = TcpStream>

Returns the socket address of the remote peer of this TCP connection.

Returns the socket address of the local half of this TCP connection.

Shuts down the read, write, or both halves of this connection.

This function will cause all pending and future I/O on the specified portions to return immediately with an appropriate value (see the documentation of Shutdown).

Sets the value of the TCP_NODELAY option on this socket.

If set, this option disables the Nagle algorithm. This means that segments are always sent as soon as possible, even if there is only a small amount of data. When not set, data is buffered until there is a sufficient amount to send out, thereby avoiding the frequent sending of small packets.

Notes

On Windows make sure the stream is connected before calling this method, by receiving an (writable) event. Trying to set nodelay on an unconnected TcpStream is undefined behavior.

Gets the value of the TCP_NODELAY option on this socket.

For more information about this option, see set_nodelay.

Notes

On Windows make sure the stream is connected before calling this method, by receiving an (writable) event. Trying to get nodelay on an unconnected TcpStream is undefined behavior.

Sets the value for the IP_TTL option on this socket.

This value sets the time-to-live field that is used in every packet sent from this socket.

Notes

On Windows make sure the stream is connected before calling this method, by receiving an (writable) event. Trying to set ttl on an unconnected TcpStream is undefined behavior.

Gets the value of the IP_TTL option for this socket.

For more information about this option, see set_ttl.

Notes

On Windows make sure the stream is connected before calling this method, by receiving an (writable) event. Trying to get ttl on an unconnected TcpStream is undefined behavior.

Get the value of the SO_ERROR option on this socket.

This will retrieve the stored error in the underlying socket, clearing the field in the process. This can be useful for checking errors between calls.

Receives data on the socket from the remote address to which it is connected, without removing that data from the queue. On success, returns the number of bytes peeked.

Successive calls return the same data. This is accomplished by passing MSG_PEEK as a flag to the underlying recv system call.

Trait Implementations

Extracts the raw file descriptor. Read more

Extracts the raw file descriptor. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Performs the conversion.

Performs the conversion.

Constructs a new instance of Self from the given raw file descriptor. Read more

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Like read, except that it reads into a slice of buffers. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, appending them to buf. Read more

Read the exact number of bytes required to fill buf. Read more

🔬 This is a nightly-only experimental API. (can_vector)

Determines if this Reader has an efficient read_vectored implementation. Read more

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Creates a “by reference” adapter for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

Creates an adapter which will chain this stream with another. Read more

Creates an adapter which will read at most limit bytes from it. Read more

Register self with the given Registry instance. Read more

Re-register self with the given Registry instance. Read more

Deregister self from the given Registry instance. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Write a buffer into this writer, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Like write, except that it writes from a slice of buffers. Read more

Attempts to write an entire buffer into this writer. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

🔬 This is a nightly-only experimental API. (can_vector)

Determines if this Writer has an efficient write_vectored implementation. Read more

🔬 This is a nightly-only experimental API. (write_all_vectored)

Attempts to write multiple buffers into this writer. Read more

Creates a “by reference” adapter for this instance of Write. 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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

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.