class EncodedMessage

Defined at line 35 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

|EncodedMessage| represents an encoded FIDL message consisting of some

contiguous bytes and handles. See

https://fuchsia.dev/fuchsia-src/reference/fidl/language/wire-format?hl=en#message

|EncodedMessage| does not own the storage behind the bytes and handles. But

handles are owned by it and closed when the |EncodedMessage| is destroyed.

Public Methods

EncodedMessage Create (cpp20::span<uint8_t> bytes)

Creates an |EncodedMessage| consisting of only |bytes| and no handles.

Defined at line 30 of file ../../sdk/lib/fidl/cpp/wire/incoming_message.cc

EncodedMessage Create (cpp20::span<uint8_t> bytes, zx_handle_t * handles, fidl_channel_handle_metadata_t * handle_metadata, uint32_t handle_actual)

Creates an |EncodedMessage| representing a message received from Zircon

channels.

|handle_metadata| should point to an array with the same length as

|handles|. Each member in |handle_metadata| describes the type and rights

associated with the corresponding handle. This information is typically

obtained from the array of |zx_handle_info_t| coming from a channel read.

Defined at line 34 of file ../../sdk/lib/fidl/cpp/wire/incoming_message.cc

std::pair<cpp20::span<uint8_t>, cpp20::span<fidl_handle_t>> Release ()

Convert the incoming message to its constituent parts, releasing the ownership of handles to

the caller in the process. This consumes the |EncodedMessage|.

Defined at line 41 of file ../../sdk/lib/fidl/cpp/wire/incoming_message.cc

void ~EncodedMessage ()

Defined at line 49 of file ../../sdk/lib/fidl/cpp/wire/incoming_message.cc

void CloseHandles ()

Closes the handles managed by this message. This may be used when the code

would like to consume a |EncodedMessage

&

&

| and close its handles, but does

not want to incur the overhead of moving it into a regular

|EncodedMessage| object, and running the destructor.

This consumes the |EncodedMessage|.

Defined at line 51 of file ../../sdk/lib/fidl/cpp/wire/incoming_message.cc

template <typename Transport>
EncodedMessage Create (cpp20::span<uint8_t> bytes, fidl_handle_t * handles, typename Transport::HandleMetadata * handle_metadata, uint32_t handle_actual)

Creates an |EncodedMessage| which manages a FIDL message from a custom

transport.

|Transport| should be a type that represents a FIDL transport.

|HandleMetadata| is the type of metadata associated with handles being sent

over that transport.

This function is generally reserved for internal use. Transport

implementations should offer non-templated free functions that creates

|EncodedMessage| given handle metadata specific to that transport.

Defined at line 62 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

EncodedMessage Create (cpp20::span<uint8_t> bytes)

Creates an |EncodedMessage| consisting of only |bytes| and no handles.

EncodedMessage Create (cpp20::span<uint8_t> bytes, zx_handle_t * handles, fidl_channel_handle_metadata_t * handle_metadata, uint32_t handle_actual)

Creates an |EncodedMessage| representing a message received from Zircon

channels.

|handle_metadata| should point to an array with the same length as

|handles|. Each member in |handle_metadata| describes the type and rights

associated with the corresponding handle. This information is typically

obtained from the array of |zx_handle_info_t| coming from a channel read.

template <typename Transport>
EncodedMessage Create (cpp20::span<uint8_t> bytes, fidl_handle_t * handles, typename Transport::HandleMetadata * handle_metadata, uint32_t handle_actual)

Creates an |EncodedMessage| which manages a FIDL message from a custom

transport.

|Transport| should be a type that represents a FIDL transport.

|HandleMetadata| is the type of metadata associated with handles being sent

over that transport.

This function is generally reserved for internal use. Transport

implementations should offer non-templated free functions that creates

|EncodedMessage| given handle metadata specific to that transport.

Defined at line 62 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

void EncodedMessage (const EncodedMessage & )

Defined at line 74 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

EncodedMessage & operator= (const EncodedMessage & )

Defined at line 75 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

void EncodedMessage (EncodedMessage && other)

Defined at line 77 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

EncodedMessage & operator= (EncodedMessage && other)

Defined at line 78 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

cpp20::span<uint8_t> bytes ()

Defined at line 87 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

fidl_handle_t * handles ()

Defined at line 89 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

uint32_t num_handles ()

Defined at line 90 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

fidl_handle_metadata_t * raw_handle_metadata ()

Defined at line 91 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

template <typename Transport>
typename Transport::HandleMetadata * handle_metadata ()

Defined at line 94 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

void ReleaseHandles ()

Release the handle ownership after the message has been converted to its

decoded form. When used standalone and not as part of a decode, this method

is only useful when interfacing with C APIs.

This consumes the |EncodedMessage|.

Defined at line 104 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/incoming_message.h

Friends

Status EncodedMessage (::fidl::WireFormatMetadata metadata, size_t inline_size, ::fidl::internal::TopLevelDecodeFn decode_fn, ::fidl::EncodedMessage & message)
class NaturalDecoder
class IncomingHeaderAndMessage