pub struct DuplexMsgPipeStream { /* private fields */ }
Available on Windows and crate feature tokio_support only.
Expand description

Message stream reader and writer for a Tokio-based named pipe.

Created either by using PipeListener or by connecting to a named pipe server.

Implementations

Tries to connect to the specified named pipe (the \\.\pipe\ prefix is added automatically).

If there is no available server, returns immediately with the WouldBlock error.

Tries to connect to the specified named pipe at a remote computer (the \\<hostname>\pipe\ prefix is added automatically).

If there is no available server, returns immediately with the WouldBlock error.

Returns true if the stream was created by a listener (server-side), false if it was created by connecting to a server (client-side).

Returns true if the stream was created by connecting to a server (client-side), false if it was created by a listener (server-side).

Creates a Tokio-based async object from a given raw handle. This will also attach the object to the Tokio runtime this function is called in, so calling it outside a runtime will result in an error (which is why the FromRawHandle trait can’t be implemented instead).

Safety

The given handle must be valid (i.e. refer to an existing kernel object) and must not be owned by any other handle container. If this is not upheld, an arbitrary handle will be closed when the returned object is dropped.

Splits the duplex stream into its reading and writing half.

Retrieves the process identifier of the client side of the named pipe connection.

Retrieves the session identifier of the client side of the named pipe connection.

Retrieves the process identifier of the server side of the named pipe connection.

Retrieves the session identifier of the server side of the named pipe connection.

Disconnects the named pipe stream without flushing buffers, causing all data in those buffers to be lost. This is much faster (and, in some case, the only finite-time way of ending things) than simply dropping the stream, since, for non-async named pipes, the Drop implementation flushes first.

Only makes sense for server-side pipes and will return an error if called on a client stream. For async pipe streams, this is the same as dropping the pipe.

Trait Implementations

Attempt to read from the AsyncRead into buf. Read more
Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more
Attempt to read from the AsyncRead into buf. Read more
Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more
Attempt to write bytes from buf into the object. Read more
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
Attempt to close the object. Read more
Attempt to write bytes from bufs into the object using vectored IO operations. Read more
Attempt to write bytes from buf into the object. Read more
Attempt to flush the object, ensuring that any buffered data reach their destination. Read more
Attempt to close the object. Read more
Attempt to write bytes from bufs into the object using vectored IO operations. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more
The data stream flow direction for the pipe. See the PipeStreamRole enumeration for more on what this means.
The data stream mode for the pipe. If set to PipeMode::Bytes, message boundaries will broken and having READ_MODE at PipeMode::Messages would be a pipe creation error. Read more
The data stream mode used when reading from the pipe: if WRITE_MODE is PipeMode::Messages and READ_MODE is PipeMode::Bytes, the message boundaries will be destroyed when reading even though they are retained when written. See the PipeMode enumeration for more on what those modes mean. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Reads some bytes from the byte stream. Read more
Like [read()][AsyncReadExt::read()], except it reads into a slice of buffers. Read more
Reads the entire contents and appends them to a Vec. Read more
Reads the entire contents and appends them to a String. Read more
Reads the exact number of bytes required to fill buf. Read more
Creates an adapter which will read at most limit bytes from it. Read more
Converts this AsyncRead into a Stream of bytes. Read more
Creates an adapter which will chain this stream with another. Read more
Boxes the reader and changes its type to dyn AsyncRead + Send + 'a. Read more
Writes some bytes into the byte stream. Read more
Like [write()][AsyncWriteExt::write()], except that it writes a slice of buffers. Read more
Writes an entire buffer into the byte stream. Read more
Flushes the stream to ensure that all buffered contents reach their destination. Read more
Closes the writer. Read more
Boxes the writer and changes its type to dyn AsyncWrite + Send + 'a. 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.

Converts to T by calling Into<T>::into.
Tries to convert to T by calling TryInto<T>::try_into.
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.