pipe.read_stream

Functions

new() → pipe.read_stream

new()                    (1)
new(fd: file_descriptor) (2)
1 Default constructor.
2 Converts a file descriptor into a pipe end.

close(self)

Close the pipe.

Any asynchronous read operations will be cancelled immediately, and will complete with the boost::asio::error::operation_aborted error.

cancel(self)

Cancel all asynchronous operations associated with the pipe.

This function causes all outstanding asynchronous read operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted error.

assign(self, fd: file_descriptor)

Assign an existing native pipe to self.

release(self) → file_descriptor

Release ownership of the native descriptor implementation.

This function causes all outstanding asynchronous read operations to finish immediately, and the handlers for cancelled operations will be passed the boost::asio::error::operation_aborted error. Ownership of the native pipe is then transferred to the caller.

read_some(self, buffer: byte_span) → integer

Read data from the pipe and blocks current fiber until it completes or errs.

Returns the number of bytes read.

Properties

is_open: boolean

Whether the pipe is open.