Synchronous, non-owning stage output borrow with const mutation forwarding.
More...
#include <StormByte/buffer/pipe.hxx>
|
| | PipeOutput (WriteOnly &output) noexcept |
| | Borrow a live stream output.
|
| bool | Write (const StormByte::Safe::Binary &data) const noexcept |
| | Copy bytes to the borrowed writer.
|
| bool | Write (StormByte::Safe::Binary &&data) const noexcept |
| | Move bytes to the borrowed writer.
|
| bool | Write (std::string_view text) const noexcept |
| | Copy length-aware text without a trailing NUL.
|
| bool | IsWritable () const noexcept |
| | Query whether the writer accepts more data.
|
| void | Close () const noexcept |
| | Close the borrowed output and wake readers.
|
| void | SetError () const noexcept |
| | Fail the borrowed output and wake waiters.
|
Synchronous, non-owning stage output borrow with const mutation forwarding.
- Warning
- Neither this facade nor its copies may outlive the callback. Constness does not make the underlying writer immutable or thread-safe.
◆ PipeOutput()
| StormByte::Buffer::PipeOutput::PipeOutput |
( |
WriteOnly & | output | ) |
|
|
explicitnoexcept |
Borrow a live stream output.
- Parameters
-
| output | Buffer kept alive by the caller for the whole invocation. |
◆ Close()
| void StormByte::Buffer::PipeOutput::Close |
( |
| ) |
const |
|
noexcept |
Close the borrowed output and wake readers.
◆ IsWritable()
| bool StormByte::Buffer::PipeOutput::IsWritable |
( |
| ) |
const |
|
noexcept |
Query whether the writer accepts more data.
- Returns
- Whether the stream is writable.
◆ SetError()
| void StormByte::Buffer::PipeOutput::SetError |
( |
| ) |
const |
|
noexcept |
Fail the borrowed output and wake waiters.
◆ Write() [1/3]
Copy bytes to the borrowed writer.
- Parameters
-
- Returns
- Whether the write succeeded.
◆ Write() [2/3]
| bool StormByte::Buffer::PipeOutput::Write |
( |
std::string_view | text | ) |
const |
|
noexcept |
Copy length-aware text without a trailing NUL.
- Parameters
-
| text | Text to append, including embedded NULs. Borrowed only for this write. |
- Returns
- Whether the write succeeded.
◆ Write() [3/3]
Move bytes to the borrowed writer.
- Parameters
-
- Returns
- Whether the write succeeded.
The documentation for this class was generated from the following file: