Portals0.7.0 · dev (544a5c68c72e · 2026-11-28 UTC)
Loading...
Searching...
No Matches
portals::WindowConsumer< T > Class Template Reference

Move-only UI consumer. Fetch continuation/retry tokens with takeRequest(), then dispatch on a worker. More...

#include <window_source.hpp>

Public Member Functions

 WindowConsumer ()=default
 Empty closed consumer.
 ~WindowConsumer ()
 Cancel without waiting; outstanding owners retain credit.
 WindowConsumer (WindowConsumer &&other) noexcept
 Transfer on UI.
WindowConsumer & operator= (WindowConsumer other) noexcept
 WindowConsumer (const WindowConsumer &)=delete
std::expected< void, SourceError > cancel ()
void close () noexcept
 Close on UI; no implicit restart follows explicit cancellation.
std::expected< WindowRequest< T >, SourceError > request (SourceAnchor anchor, SourceDirection direction, std::size_t viewportRows)
std::expected< std::optional< WindowRequest< T > >, SourceError > takeRequest ()
std::expected< WindowPin< T >, SourceError > pin () const
std::expected< WindowStatus, SourceError > status () const
std::expected< std::optional< SourceError >, SourceError > lastError () const
std::expected< std::optional< SourceCursor >, SourceError > recovery () const

Friends

template<class>
class WindowSource

Detailed Description

template<class T>
class portals::WindowConsumer< T >

Move-only UI consumer. Fetch continuation/retry tokens with takeRequest(), then dispatch on a worker.

Template Parameters
TImmutable row value; pins remain readable after consumer/source destruction.

Constructor & Destructor Documentation

◆ WindowConsumer()

template<class T>
portals::WindowConsumer< T >::WindowConsumer ( WindowConsumer< T > && other)
inlinenoexcept

Transfer on UI.

Parameters
otherUI owner to transfer and leave empty; foreign-thread transfer terminates.

Member Function Documentation

◆ cancel()

template<class T>
std::expected< void, SourceError > portals::WindowConsumer< T >::cancel ( )
inline
Returns
Success after cancelling the current navigation intent without closing this consumer. Later readiness notifications do not restart it; an explicit request is required.

◆ lastError()

template<class T>
std::expected< std::optional< SourceError >, SourceError > portals::WindowConsumer< T >::lastError ( ) const
inline
Returns
Sticky last protocol/admission failure on UI, or CLOSED/WRONG_THREAD.

◆ operator=()

template<class T>
WindowConsumer & portals::WindowConsumer< T >::operator= ( WindowConsumer< T > other)
inlinenoexcept
Parameters
otherReplacement UI owner.
Returns
This owner; old consumer closes after replacement.

◆ pin()

template<class T>
std::expected< WindowPin< T >, SourceError > portals::WindowConsumer< T >::pin ( ) const
inline
Returns
Cheap last committed pin; pending/errors never replace its valid rows.

◆ recovery()

template<class T>
std::expected< std::optional< SourceCursor >, SourceError > portals::WindowConsumer< T >::recovery ( ) const
inline
Returns
Explicit unavailable-history recovery, never an automatically substituted cursor.

◆ request()

template<class T>
std::expected< WindowRequest< T >, SourceError > portals::WindowConsumer< T >::request ( SourceAnchor anchor,
SourceDirection direction,
std::size_t viewportRows )
inline
Parameters
anchorProvider entry or supported gap/seek operation.
directionRequested traversal direction.
viewportRowsPositive layout-derived target, including desired overscan.
Returns
First admitted worker token; rejection preserves the previous navigation/window.

◆ status()

template<class T>
std::expected< WindowStatus, SourceError > portals::WindowConsumer< T >::status ( ) const
inline
Returns
Current outcome on UI, or CLOSED/WRONG_THREAD.

◆ takeRequest()

template<class T>
std::expected< std::optional< WindowRequest< T > >, SourceError > portals::WindowConsumer< T >::takeRequest ( )
inline
Returns
Next admitted continuation/latest-readiness token, or empty; never starts a worker.

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