class UnbindInfo

Defined at line 514 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

|UnbindInfo| describes how the channel was unbound from a server or client.

The reason is always initialized when part of a |fidl::UnbindInfo|.

|UnbindInfo| is passed to |OnUnboundFn| and |AsyncEventHandler::Unbound| if

provided by the user.

Public Methods

std::string FormatDescription ()

Renders a full description of the cause of the unbinding.

It is more specific than |reason| alone e.g. if an encoding error was

encountered, it would contain a string description of the specific encoding

problem.

If a logging API supports output streams (`

<

<

` operators), piping the

|UnbindInfo| to the log via `

<

<

` is more efficient than calling this

function.

Defined at line 206 of file ../../sdk/lib/fidl/cpp/wire/status.cc

void UnbindInfo ()

Creates an invalid |UnbindInfo|.

Defined at line 517 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

void ~UnbindInfo ()

Defined at line 518 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

void UnbindInfo (const Status & result)

Defined at line 520 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo UnknownOrdinal ()

Defined at line 524 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo Unbind ()

Constructs an |UnbindInfo| indicating that the user explicitly requested

unbinding the server endpoint from the dispatcher.

**Note that this is not the same as |Status::Unbound|**:

|Status::Unbound| means an operation failed because the required endpoint

has been unbound, and is an error. |UnbindInfo::Unbind| on the other hand

is an expected result from user initiation.

Defined at line 533 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo Close (zx_status_t status)

Constructs an |UnbindInfo| indicating that the server connection is

closed explicitly by the user. |status| is the status of writing

the epitaph to the channel. This is specific to the server bindings.

Internally in the bindings runtime, |status| is also used to indicate

which epitaph value should be sent. But this is not re-exposed to the user

since the user provided the epitaph in the first place.

Defined at line 544 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo PeerClosed (zx_status_t status)

Constructs an |UnbindInfo| indicating that the endpoint peer has

closed.

Defined at line 550 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo DispatcherError (zx_status_t status)

Constructs an |UnbindInfo| indicating the async dispatcher returned

an error |status|.

Defined at line 556 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo AbandonedAsyncReply ()

Constructs an |UnbindInfo| indicating the user discarded an async completer

that was expecting a reply.

Defined at line 562 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

void UnbindInfo (const UnbindInfo & )

Defined at line 566 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

UnbindInfo & operator= (const UnbindInfo & )

Defined at line 567 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

bool is_user_initiated ()

Returns true if the unbinding was initiated by the user, that is, the user

called Unbind/Close on the server side to proactively teardown the

connection.

This case is only observable from the server side. Note that the client

side `on_fidl_error` method on the event handler is never called with an

|UnbindInfo| that is user initiated - `on_fidl_error` is meant to handle

errors.

Defined at line 616 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

bool is_peer_closed ()

Returns if the transport was unbound because the peer endpoint was closed.

This error is of interest since some protocol users may consider the peer

going away to be part of its normal operation, while others might not.

Defined at line 632 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

bool did_send_epitaph ()

Returns if the user invoked `Close(epitaph)` on a |fidl::ServerBindingRef| or

completer and the epitaph was sent.

This case is only observable from the server side.

|status| is the result of sending the epitaph.

Defined at line 644 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

fidl::Error ToError ()

Reinterprets the |UnbindInfo| as the cause of an operation failure.

Defined at line 647 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/status.h

Friends

std::ostream & UnbindInfo (std::ostream & ostreamconst UnbindInfo & info)