class ResponseContext
Defined at line 80 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
|ResponseContext| contains information about an outstanding asynchronous
method call. It inherits from an intrusive container node so that
|ClientBase| can track it without requiring heap allocation.
The generated code will define type-specific response contexts e.g.
|fidl::WireResponseContext
<FooMethod
>|, that inherits from |ResponseContext|
and interprets the bytes passed to the |OnRawResult| call appropriately.
Users should interact with those subclasses; see the lifecycle notes on
|WireResponseContext|.
NOTE: |ResponseContext| are additionally referenced with a |list_node_t|
in order to safely iterate over outstanding transactions on |ClientBase|
destruction, releasing each outstanding response context.
Public Methods
std::optional<fidl::UnbindInfo> OnRawResult (::fidl::IncomingHeaderAndMessage && result, internal::MessageStorageViewBase * storage_view)
Invoked when a response has been received or an error was detected for this
context. |OnRawResult| is allowed to consume the current object.
## If |result| represents a success
|result| references the incoming message in encoded form.
Ownership of bytes referenced by |result| stays with the caller.
The callee should not access the bytes in |result| once this method returns.
Ownership of handles referenced by |result| is transferred to the callee.
If there was an error decoding |result|, the implementation should return
that error as a present |fidl::UnbindInfo|. Otherwise, the implementation
should return |std::nullopt|.
## If |result| represents an error
An error occurred while processing this FIDL call:
- Failed to encode the outgoing request specific to this call.
- The peer endpoint was closed.
- Error from the |async_dispatcher_t|.
- Error from the underlying transport.
- The server sent a malformed message.
- The user explicitly initiated binding teardown.
- The call raced with an external error in the meantime that caused binding
teardown.
See |WireResponseContext
<FidlMethod
>::OnResult| for more details.
void ResponseContext (uint64_t ordinal)
Defined at line 84 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
void ~ResponseContext ()
Defined at line 88 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
void ResponseContext (const ResponseContext & other)
|ResponseContext| objects are "pinned" in memory.
Defined at line 91 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
ResponseContext & operator= (const ResponseContext & other)
Defined at line 92 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
void ResponseContext (ResponseContext && other)
Defined at line 93 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
ResponseContext & operator= (ResponseContext && other)
Defined at line 94 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
uint64_t ordinal ()
Defined at line 96 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
zx_txid_t Txid ()
Defined at line 97 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
void OnError (::fidl::Status error)
A helper around |OnRawResult| to directly notify an error to the context.
Defined at line 134 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/client_base.h
Friends
class ClientBase
class ResponseContextAsyncErrorTask