Future representing an outbound write or stream completion.
Waits for a write reservation, serializes Message into the reserved buffer (unless Message is void, as for Writer::Finish()), and commits the write.
A ConstBuf message is copied into the reserved buffer; if it owns its memory, that memory is released as soon as the write completes.
Public Member Functions | |
| WriteFuture (const WriteFuture &)=delete | |
| WriteFuture & | operator= (const WriteFuture &)=delete |
| WriteFuture (WriteFuture &&other) noexcept=default | |
| WriteFuture & | operator= (WriteFuture &&other) noexcept=default |
| async2::Poll< RpcStatus > | Pend (async2::Context &cx) |
Public Member Functions inherited from pw::rpc2::internal::WriteFutureBase | |
| WriteFutureBase (const WriteFutureBase &)=delete | |
| WriteFutureBase & | operator= (const WriteFutureBase &)=delete |
| bool | is_pendable () const |
| bool | is_complete () const |
Friends | |
| template<typename > | |
| class | Writer |
| template<typename > | |
| class | UnaryWriter |
| struct | internal::CallAccess |
Additional Inherited Members | |
Public Types inherited from pw::rpc2::internal::WriteFutureBase | |
| using | value_type = RpcStatus |
Protected Member Functions inherited from pw::rpc2::internal::WriteFutureBase | |
| WriteFutureBase (ReserveWriteFuture &&res_fut) | |
| WriteFutureBase (WriteFutureBase &&) noexcept=default | |
| WriteFutureBase & | operator= (WriteFutureBase &&) noexcept=default |
| async2::Poll< RpcResult< IntrusivePtr< Call > > > | PendWriteAndTakeCall (async2::Context &cx, const void *message, SerializeFn serialize) |
| async2::Poll< RpcStatus > | PendWrite (async2::Context &cx, const void *message, SerializeFn serialize) |
|
inline |
Polls the outbound write until it is committed.
kOk once the message or completion has been committed.kWriteClosed if the writer is already closed, empty, or moved from.kMessageTooLarge if the encoded message does not fit in the write buffer or exceeds the maximum write size. Nothing was sent, and the call is still open.kDataError if the message serializer failed for any other reason. Nothing was sent, and the call is still open.kCancelled or kDisconnected) if the call ended with an error. See Error handling.kDisconnected if the connection closed before the write was sent.