userver: engine::io::ReadableBase Class Reference
Loading...
Searching...
No Matches
engine::io::ReadableBase Class Referenceabstract

#include <userver/engine/io/common.hpp>

Detailed Description

Interface for readable streams

Definition at line 25 of file common.hpp.

+ Inheritance diagram for engine::io::ReadableBase:

Public Member Functions

virtual bool IsValid () const =0
 Whether the stream is valid.
 
virtual bool WaitReadable (Deadline)=0
 Suspends current task until the stream has data available.
 
virtual size_t ReadSome (void *buf, size_t len, Deadline deadline)=0
 Receives at least one byte from the stream.
 
virtual size_t ReadAll (void *buf, size_t len, Deadline deadline)=0
 
impl::ContextAccessor * TryGetContextAccessor ()
 For internal use only.
 

Protected Member Functions

void SetReadableContextAccessor (impl::ContextAccessor *ca)
 

Member Function Documentation

◆ IsValid()

virtual bool engine::io::ReadableBase::IsValid ( ) const
pure virtual

Whether the stream is valid.

Implemented in engine::io::PipeReader, engine::io::Socket, and engine::io::TlsWrapper.

◆ ReadAll()

virtual size_t engine::io::ReadableBase::ReadAll ( void * buf,
size_t len,
Deadline deadline )
pure virtual

Receives exactly len bytes from the stream.

Note
Can return less than len if stream is closed by peer.

Implemented in engine::io::PipeReader, engine::io::Socket, and engine::io::TlsWrapper.

◆ ReadSome()

virtual size_t engine::io::ReadableBase::ReadSome ( void * buf,
size_t len,
Deadline deadline )
pure virtual

Receives at least one byte from the stream.

Implemented in engine::io::PipeReader, engine::io::Socket, and engine::io::TlsWrapper.

◆ SetReadableContextAccessor()

void engine::io::ReadableBase::SetReadableContextAccessor ( impl::ContextAccessor * ca)
inlineprotected

Definition at line 48 of file common.hpp.

◆ TryGetContextAccessor()

impl::ContextAccessor * engine::io::ReadableBase::TryGetContextAccessor ( )
inline

For internal use only.

Definition at line 45 of file common.hpp.

◆ WaitReadable()

virtual bool engine::io::ReadableBase::WaitReadable ( Deadline )
pure virtual

Suspends current task until the stream has data available.

Implemented in engine::io::PipeReader, engine::io::Socket, and engine::io::TlsWrapper.


The documentation for this class was generated from the following file: