Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. pw_rpc2
  5. Readers and writers
  6. pw::rpc2::ReserveWriteFuture Class Reference
Loading...
Searching...
No Matches
pw::rpc2::ReserveWriteFuture Class Reference

Overview

Future returned by Writer::ReserveWrite() and UnaryWriter::ReserveFinish() that resolves to a WriteReservation.

Inheritance diagram for pw::rpc2::ReserveWriteFuture:
pw::rpc2::internal::FutureBase

Public Types

using value_type = RpcResult< WriteReservation >
 

Public Member Functions

 ReserveWriteFuture (const ReserveWriteFuture &)=delete
 
ReserveWriteFuture & operator= (const ReserveWriteFuture &)=delete
 
 ReserveWriteFuture (ReserveWriteFuture &&other) noexcept=default
 
ReserveWriteFuture & operator= (ReserveWriteFuture &&other) noexcept
 
async2::Poll< RpcResult< WriteReservation > > Pend (async2::Context &cx)
 
- Public Member Functions inherited from pw::rpc2::internal::FutureBase
 FutureBase (const FutureBase &)=delete
 
FutureBase & operator= (const FutureBase &)=delete
 
constexpr bool is_pendable () const
 
constexpr bool is_complete () const
 

Friends

class internal::GeneratedServiceClient
 
class internal::UnaryFutureBase
 
class internal::WriterBase
 
struct internal::CallAccess
 

Additional Inherited Members

- Protected Member Functions inherited from pw::rpc2::internal::FutureBase
constexpr FutureBase (async2::FutureState::Pending)
 
constexpr FutureBase (async2::FutureState state)
 
constexpr FutureBase (FutureBase &&) noexcept=default
 
constexpr FutureBase & operator= (FutureBase &&) noexcept=default
 
constexpr void mark_pending ()
 
void mark_complete ()
 

Member Function Documentation

◆ Pend()

async2::Poll< RpcResult< WriteReservation > > pw::rpc2::ReserveWriteFuture::Pend ( async2::Context &  cx)

Polls for the write reservation.

Returns
  • kOk with a WriteReservation once buffer space is available.
  • kWriteClosed if the writer is already closed, empty, or moved from.
  • kMessageTooLarge if the requested size exceeds the maximum write size.
  • The call's completion status (such as kCancelled or kDisconnected) if the call ended with an error. See Error handling.
  • kDisconnected if the connection closed while waiting for buffer space.
  • For a client call that has not started: kClosed if the client is empty or was closed, the reason its connection closed (kDisconnected or kProtocolError) if it closed on its own, or kResourceExhausted if the call could not be allocated.

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