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

Nonmovable build scope, valid only inside withBuild's worker callback. More...

#include <worker_storage.hpp>

Public Member Functions

 WorkerStorageBuild (const WorkerStorageBuild &)=delete
WorkerStorageBuild & operator= (const WorkerStorageBuild &)=delete
 WorkerStorageBuild (WorkerStorageBuild &&)=delete
WorkerStorageBuild & operator= (WorkerStorageBuild &&)=delete
std::expected< void, BackgroundError > commit (std::unique_ptr< WorkerStorageValue > &value, std::size_t bytes)
std::size_t residentCap () const noexcept
std::size_t scratchCap () const noexcept

Friends

class BackgroundWorkerStorage

Detailed Description

Nonmovable build scope, valid only inside withBuild's worker callback.

Member Function Documentation

◆ commit()

std::expected< void, BackgroundError > portals::WorkerStorageBuild::commit ( std::unique_ptr< WorkerStorageValue > & value,
std::size_t bytes )
Parameters
valueWorker-owned fully prepared value, preserved on rejection.
bytesActual resident allocation capacity, including payload metadata.
Returns
Success after ownership transfer or LIMIT_EXCEEDED/INVALID_ARGUMENT. All scratch allocations must be destroyed before the enclosing callback returns.

◆ residentCap()

std::size_t portals::WorkerStorageBuild::residentCap ( ) const
inlinenoexcept
Returns
Reserved resident byte ceiling; allocations must respect transient peak too.

◆ scratchCap()

std::size_t portals::WorkerStorageBuild::scratchCap ( ) const
inlinenoexcept
Returns
Reserved scratch byte ceiling, retained until callback locals have been destroyed.

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