template <typename Protocol>

struct Endpoints

Defined at line 26 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/channel.h

Public Members

fidl::ClientEnd<Protocol> client
fidl::ServerEnd<Protocol> server

Public Methods

Endpoints<Protocol> Create ()

Creates a pair of Zircon channel endpoints speaking the |Protocol| protocol.

Whenever interacting with FIDL, using this method should be encouraged over

|zx::channel::create|, because this method encodes the precise protocol type

into its results at compile time.

The return value is struct containing client and server endpoints.

Given the following:

auto endpoints = fidl::CreateEndpoints

<MyProtocol

>();

The channel endpoints may be accessed via:

endpoints->client;

endpoints->server;

Or you may use structured bindings to gain access:

auto [client_end, server_end] = fidl::Endpoints

<MyProtocol

>::Create();

Defined at line 48 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/channel.h

fidl::ServerEnd<Protocol> Create (fidl::ClientEnd<Protocol> * out_client)

Creates a pair of Zircon channel endpoints speaking the |Protocol| protocol.

Whenever interacting with FIDL, using this method should be encouraged over

|zx::channel::create|, because this method encodes the precise protocol type

into its results at compile time.

This overload of |CreateEndpoints| may lead to more concise code when the

caller already has the client endpoint defined as an instance variable.

It will replace the destination of |out_client| with a newly created client

endpoint, and return the corresponding server endpoint:

// |client_end_| is an instance variable.

auto server_end = fidl::Endpoints

<Protocol

>::Create(

&client

_end_);

Defined at line 69 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/channel.h

fidl::ClientEnd<Protocol> Create (fidl::ServerEnd<Protocol> * out_server)

Creates a pair of Zircon channel endpoints speaking the |Protocol| protocol.

Whenever interacting with FIDL, using this method should be encouraged over

|zx::channel::create|, because this method encodes the precise protocol type

into its results at compile time.

This overload of |CreateEndpoints| may lead to more concise code when the

caller already has the server endpoint defined as an instance variable.

It will replace the destination of |out_server| with a newly created server

endpoint, and return the corresponding client endpoint:

// |server_end_| is an instance variable.

auto client_end = fidl::Endpoints

<Protocol

>::Create(

&server

_end_);

Defined at line 86 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/channel.h