Main docs: Home
Functions | |
Status | pw::sys_io::ReadByte (std::byte *dest) |
Status | pw::sys_io::TryReadByte (std::byte *dest) |
Status | pw::sys_io::WriteByte (std::byte b) |
StatusWithSize | pw::sys_io::WriteLine (std::string_view s) |
StatusWithSize | pw::sys_io::ReadBytes (ByteSpan dest) |
StatusWithSize | pw::sys_io::WriteBytes (ConstByteSpan src) |
Status pw::sys_io::ReadByte | ( | std::byte * | dest | ) |
Reads a single byte from the pw_sys_io
backend. This function blocks until it either succeeds or fails to read a byte.
pw_sys_io
backend.pw_sys_io
.dest
.StatusWithSize pw::sys_io::ReadBytes | ( | ByteSpan | dest | ) |
Fills a byte span from the pw_sys_io
backend using ReadByte()
.
This function is implemented by the facade and simply uses ReadByte()
to read enough bytes to fill the destination span. If there's an error reading a byte, the read is aborted and the contents of the destination span are undefined. This function blocks until either an error occurs or all bytes are successfully read from the backend's ReadByte()
implementation.
StatusWithSize
. Status pw::sys_io::TryReadByte | ( | std::byte * | dest | ) |
Reads a single byte from the pw_sys_io
backend, if available.
pw_sys_io
backend.pw_sys_io
.dest
.Status pw::sys_io::WriteByte | ( | std::byte | b | ) |
Writes a single byte out the pw_sys_io
backend. The function blocks until it either succeeds or fails to write the byte.
pw_sys_io
backend.pw_sys_io
.StatusWithSize pw::sys_io::WriteBytes | ( | ConstByteSpan | src | ) |
Writes a span of bytes out the pw_sys_io
backend using WriteByte()
.
This function is implemented by the facade and simply writes the source contents using WriteByte()
. If an error writing a byte is encountered, the write is aborted and the error status is returned. This function blocks until either an error occurs, or all bytes are successfully written from the backend's WriteByte()
implementation.
StatusWithSize
. StatusWithSize pw::sys_io::WriteLine | ( | std::string_view | s | ) |
Writes a string out the pw_sys_io
backend.
This function takes a string_view
and writes it out the pw_sys_io
backend, adding any platform-specific newline character(s) (these are accounted for in the returned StatusWithSize
).
pw_sys_io
backend.pw_sys_io
.StatusWithSize
.