Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::ByteDocumentReadSession Class Referenceabstract

One worker-owned provisional read transaction; destroy it on its creating worker. A successful seal qualifies all preceding pages. Until then callers must not publish them. Implementations retain bounded metadata/handles only, never destination aliases. More...

#include <document_source.hpp>

Public Member Functions

virtual ~ByteDocumentReadSession ()=default
 Release worker-owned backend storage.
virtual ByteDocumentMetadata metadata () const noexcept=0
virtual std::expected< ByteReadResult, DocumentError > read (const ByteReadCommand &command, std::span< std::byte > destination, std::stop_token stop)=0
virtual std::expected< void, DocumentError > seal (std::stop_token stop)=0

Detailed Description

One worker-owned provisional read transaction; destroy it on its creating worker. A successful seal qualifies all preceding pages. Until then callers must not publish them. Implementations retain bounded metadata/handles only, never destination aliases.

Member Function Documentation

◆ metadata()

virtual ByteDocumentMetadata portals::ByteDocumentReadSession::metadata ( ) const
pure virtualnoexcept
Returns
Immutable metadata captured by opening this session, without further I/O.

◆ read()

virtual std::expected< ByteReadResult, DocumentError > portals::ByteDocumentReadSession::read ( const ByteReadCommand & command,
std::span< std::byte > destination,
std::stop_token stop )
pure virtual
Parameters
commandCaptured revision and bounded original byte offset.
destinationWritable bytes borrowed only for this call.
stopCooperative cancellation.
Returns
Provisional initialized bytes/EOF, or an exact typed failure.

◆ seal()

virtual std::expected< void, DocumentError > portals::ByteDocumentReadSession::seal ( std::stop_token stop)
pure virtual
Parameters
stopCooperative cancellation of final path/revision validation.
Returns
Success qualifying preceding reads, or failure that forbids publishing them.

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