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

Cold exclusive file sink. Existing paths are never overwritten, including the source file. The first worker write atomically creates the output. A failed/cancelled export preserves its explicitly requested partial output; no rollback or durability is promised. More...

#include <document_export.hpp>

Inheritance diagram for portals::DocumentFileSink:
portals::DocumentFileSinkportals::DocumentFileSink portals::DocumentExportSink

Public Member Functions

 ~DocumentFileSink () override
 Close any still-owned descriptor without deleting a path.
DocumentWriteReply write (std::span< const std::byte > bytes, std::stop_token stop) override
std::expected< void, DocumentError > finish (std::stop_token stop) override
Public Member Functions inherited from portals::DocumentExportSink
virtual ~DocumentExportSink ()=default
 Release owned output handles; no scene is retained.

Static Public Member Functions

static std::expected< std::shared_ptr< DocumentFileSink >, DocumentError > create (std::filesystem::path path)

Detailed Description

Cold exclusive file sink. Existing paths are never overwritten, including the source file. The first worker write atomically creates the output. A failed/cancelled export preserves its explicitly requested partial output; no rollback or durability is promised.

Member Function Documentation

◆ create()

std::expected< std::shared_ptr< DocumentFileSink >, DocumentError > portals::DocumentFileSink::create ( std::filesystem::path path)
static
Parameters
pathOwned output path; creation performs no filesystem access.
Returns
Cold sink or allocation/invalid-path failure.

◆ finish()

std::expected< void, DocumentError > portals::DocumentFileSink::finish ( std::stop_token stop)
overridevirtual
Parameters
stopCancellation does not bypass close.
Returns
Close failure, if any; never creates a path.

Reimplemented from portals::DocumentExportSink.

◆ write()

DocumentWriteReply portals::DocumentFileSink::write ( std::span< const std::byte > bytes,
std::stop_token stop )
overridevirtual
Parameters
bytesBorrowed bounded output.
stopCooperative cancellation.
Returns
Actual native write count and native cause, including partial output.

Implements portals::DocumentExportSink.


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