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

Explicit provider conversion; no generic serializer for process-local RowId/SourceStamp exists. Caller keeps this object alive and serializes operations. Descriptor strings stay valid throughout each outer operation. Callbacks run synchronously without a new runtime; providers performing I/O must be invoked on the application's existing worker path. Codec payloads contain location metadata only, excluding values, secrets, drafts, Undo/Redo history and write authority. Callback-internal allocations are provider-owned and are not accounted by the envelope limits. No codec or borrowed span is retained. More...

#include <navigation_checkpoint.hpp>

Public Member Functions

virtual NavigationCodecDescriptor descriptor () const noexcept=0
virtual std::expected< std::size_t, NavigationCheckpointError > encode (const NavigationCheckpointEntry &entry, std::span< std::byte > output, std::stop_token stop={}) const =0
virtual std::expected< ModelBookmark, NavigationCheckpointError > decode (std::span< const std::byte > payload, PositionKind kind, PositionAffinity affinity, NavigationCheckpointRole role, std::stop_token stop={}) const =0
virtual ModelResource resource () const noexcept=0

Detailed Description

Explicit provider conversion; no generic serializer for process-local RowId/SourceStamp exists. Caller keeps this object alive and serializes operations. Descriptor strings stay valid throughout each outer operation. Callbacks run synchronously without a new runtime; providers performing I/O must be invoked on the application's existing worker path. Codec payloads contain location metadata only, excluding values, secrets, drafts, Undo/Redo history and write authority. Callback-internal allocations are provider-owned and are not accounted by the envelope limits. No codec or borrowed span is retained.

Member Function Documentation

◆ decode()

virtual std::expected< ModelBookmark, NavigationCheckpointError > portals::NavigationBookmarkCodec::decode ( std::span< const std::byte > payload,
PositionKind kind,
PositionAffinity affinity,
NavigationCheckpointRole role,
std::stop_token stop = {} ) const
pure virtual
Parameters
payloadProvider location metadata borrowed during this call only.
kindSaved position kind.
affinitySaved insertion/deletion side.
roleSaved purpose; EDIT_ANCHOR does not authorize a write.
stopCooperative cancellation.
Returns
Requalified in-memory bookmark for the current provider resource, or typed failure.

◆ descriptor()

virtual NavigationCodecDescriptor portals::NavigationBookmarkCodec::descriptor ( ) const
pure virtualnoexcept
Returns
Portable codec/resource qualification valid throughout the outer operation.

◆ encode()

virtual std::expected< std::size_t, NavigationCheckpointError > portals::NavigationBookmarkCodec::encode ( const NavigationCheckpointEntry & entry,
std::span< std::byte > output,
std::stop_token stop = {} ) const
pure virtual
Parameters
entryQualified source bookmark and location purpose.
outputBounded output capacity; no bytes outside this span may be written.
stopCooperative cancellation.
Returns
Number of written bytes, or a typed provider failure.

◆ resource()

virtual ModelResource portals::NavigationBookmarkCodec::resource ( ) const
pure virtualnoexcept
Returns
Live in-memory resource domain for decoded bookmarks; rechecked after each callback.

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