mirror of
https://github.com/matrix-construct/construct
synced 2024-11-18 07:50:57 +01:00
ircd::buffer: Allow returning completed() mutable_buffer.
This commit is contained in:
parent
314bcb3d30
commit
af0c02cc10
1 changed files with 8 additions and 0 deletions
|
@ -421,6 +421,14 @@ struct ircd::buffer::stream_buffer
|
|||
return { base.begin(), base.begin() + consumed() };
|
||||
}
|
||||
|
||||
/// View the completed portion of the stream
|
||||
mutable_buffer completed()
|
||||
{
|
||||
assert(base.begin() <= begin());
|
||||
assert(base.begin() + consumed() <= base.end());
|
||||
return { base.begin(), base.begin() + consumed() };
|
||||
}
|
||||
|
||||
/// Convenience conversion to get the completed portion
|
||||
explicit operator const_buffer() const
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue