namespace zx

Records

Functions

operator<<

std::ostream & operator<<(std::ostream & os, const zx::object_base & value)

Defined at line 48 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::channel & value)

Defined at line 53 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::eventpair & value)

Defined at line 58 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::fifo & value)

Defined at line 63 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::process & value)

Defined at line 68 of file ../../src/lib/fostr/zx_types.cc

operator<<

::std::ostream & operator<<(::std::ostream & out, basic_time t)

Defined at line 71 of file ../../src/media/audio/services/common/logging.h

operator<<

::std::ostream & operator<<(::std::ostream & out, duration d)

Defined at line 75 of file ../../src/media/audio/services/common/logging.h

operator<<

std::ostream & operator<<(std::ostream & os, const zx::socket & value)

Defined at line 80 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::thread & value)

Defined at line 85 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::duration & value)

Defined at line 97 of file ../../src/lib/fostr/zx_types.cc

operator*

duration operator*(int64_t multiplier, duration d)

Defined at line 111 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

operator*

duration operator*(int64_t multiplier, duration d)

Defined at line 111 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

operator<<

std::ostream & operator<<(std::ostream & os, const zx::time & value)

Defined at line 128 of file ../../src/lib/fostr/zx_types.cc

operator<<

std::ostream & operator<<(std::ostream & os, const zx::vmo & value)

Defined at line 159 of file ../../src/lib/fostr/zx_types.cc

<deduction guide for result>

result<Tag...> <deduction guide for result>(typename Tag::__allow_ctad... )

This suppresses the '-Wctad-maybe-unsupported' compiler warning when CTAD is used.

See https://github.com/llvm/llvm-project/blob/42874f6/libcxx/include/__config#L1259-L1261.

make_result

result make_result(zx_status_t status)

Defined at line 196 of file ../../zircon/system/ulib/zx/include/lib/zx/result.h

Utility to make a status-only zx::result<> from a zx_status_t error.

A status-only zx::result<> is one with an empty value set. It may contain either a status value that represents the error (i.e. not ZX_OK) or a valueless success state. This utility automatically handles the distinction to make interop with older code easier.

Example usage:

// Legacy method returning zx_status_t. zx_status_t ConsumeValues(Value* values, size_t length);

// Newer method that interops with the legacy method. zx::result<> ConsumeValues(std::array<Value, kSize>* values) { if (values == nullptr) { return zx::error_result(ZX_ERR_INVALID_ARGS); } return zx::make_result(ConsumeValues(values->data(), values->length())); }

operator==

bool operator==(const object<T> & a, const object<T> & b)

Defined at line 203 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator!=

bool operator!=(const object<T> & a, const object<T> & b)

Defined at line 208 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<

bool operator<(const object<T> & a, const object<T> & b)

Defined at line 213 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>

bool operator>(const object<T> & a, const object<T> & b)

Defined at line 218 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<=

bool operator<=(const object<T> & a, const object<T> & b)

Defined at line 223 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>=

bool operator>=(const object<T> & a, const object<T> & b)

Defined at line 228 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator==

bool operator==(zx_handle_t a, const object<T> & b)

Defined at line 233 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator!=

bool operator!=(zx_handle_t a, const object<T> & b)

Defined at line 238 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

make_result

result<std::remove_reference_t<T>> make_result(zx_status_t status, T && value)

Defined at line 241 of file ../../zircon/system/ulib/zx/include/lib/zx/result.h

Utility to make a zx::result<T> from a zx_status_t and T.

Depending on |status|, the resulting zx::result<T> will be either zx::ok(value) or zx::error(status).

Example:

// Legacy method returning zx_status_t. zx_status_t ComputeValue(Value* value);

// Newer method that interops with the legacy method. zx::result<Value> ComputeValue() { Value value; return zx::make_result(ComputeValue(&value), value); }

Note, because the order of evaluation of function arguments is unspecified, it's critical that the second parameter to zx::make_result (`value`) is passed by reference and *not* passed by value. If it were passed by value, then its value may be bound before the first argument has been evaluated (i.e. before ComputeValue was even called!).

Furthermore, pass by reference is not always sufficient to prevent subtle order of evaluation bugs. Consider the following buggy code:

// Legacy method returning zx_status_t. zx_status_t ComputeValue(std::unique_ptr<Value>* value);

// BUGGY CODE zx::result<Value> ComputeValue() { std::unique_ptr<Value> value; return zx::make_result(ComputeValue(&value), *value); // <--- BUGGY CODE }

Depending on the compiler, the code above might work or my dereference a null std::unique_ptr. When in doubt, use a local variable.

operator<

bool operator<(zx_handle_t a, const object<T> & b)

Defined at line 243 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>

bool operator>(zx_handle_t a, const object<T> & b)

Defined at line 248 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<=

bool operator<=(zx_handle_t a, const object<T> & b)

Defined at line 253 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>=

bool operator>=(zx_handle_t a, const object<T> & b)

Defined at line 258 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator==

bool operator==(const object<T> & a, zx_handle_t b)

Defined at line 263 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator!=

bool operator!=(const object<T> & a, zx_handle_t b)

Defined at line 268 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<

bool operator<(const object<T> & a, zx_handle_t b)

Defined at line 273 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>

bool operator>(const object<T> & a, zx_handle_t b)

Defined at line 278 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<=

bool operator<=(const object<T> & a, zx_handle_t b)

Defined at line 283 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>=

bool operator>=(const object<T> & a, zx_handle_t b)

Defined at line 288 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator+

basic_time<kClockId> operator+( duration delta, basic_time<kClockId> time)

Defined at line 298 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

nsec

duration nsec(int64_t n)

Defined at line 306 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

nsec

duration nsec(int64_t n)

Defined at line 306 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

usec

duration usec(int64_t n)

Defined at line 308 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

usec

duration usec(int64_t n)

Defined at line 308 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

msec

duration msec(int64_t n)

Defined at line 310 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

msec

duration msec(int64_t n)

Defined at line 310 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

sec

duration sec(int64_t n)

Defined at line 312 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

sec

duration sec(int64_t n)

Defined at line 312 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

min

duration min(int64_t n)

Defined at line 314 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

min

duration min(int64_t n)

Defined at line 314 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

hour

duration hour(int64_t n)

Defined at line 316 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

hour

duration hour(int64_t n)

Defined at line 316 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

nanosleep

zx_status_t nanosleep( basic_time deadline)

Defined at line 318 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

deadline_after

basic_time deadline_after( duration nanoseconds)

Defined at line 322 of file ../../zircon/system/ulib/zx/include/lib/zx/time.h

operator==

bool operator==(const unowned<T> & a, const unowned<T> & b)

Defined at line 346 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator!=

bool operator!=(const unowned<T> & a, const unowned<T> & b)

Defined at line 351 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<

bool operator<(const unowned<T> & a, const unowned<T> & b)

Defined at line 356 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>

bool operator>(const unowned<T> & a, const unowned<T> & b)

Defined at line 361 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<=

bool operator<=(const unowned<T> & a, const unowned<T> & b)

Defined at line 366 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>=

bool operator>=(const unowned<T> & a, const unowned<T> & b)

Defined at line 371 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator==

bool operator==(zx_handle_t a, const unowned<T> & b)

Defined at line 376 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator!=

bool operator!=(zx_handle_t a, const unowned<T> & b)

Defined at line 381 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<

bool operator<(zx_handle_t a, const unowned<T> & b)

Defined at line 386 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>

bool operator>(zx_handle_t a, const unowned<T> & b)

Defined at line 391 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<=

bool operator<=(zx_handle_t a, const unowned<T> & b)

Defined at line 396 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>=

bool operator>=(zx_handle_t a, const unowned<T> & b)

Defined at line 401 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator==

bool operator==(const unowned<T> & a, zx_handle_t b)

Defined at line 406 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator!=

bool operator!=(const unowned<T> & a, zx_handle_t b)

Defined at line 411 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<

bool operator<(const unowned<T> & a, zx_handle_t b)

Defined at line 416 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>

bool operator>(const unowned<T> & a, zx_handle_t b)

Defined at line 421 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator<=

bool operator<=(const unowned<T> & a, zx_handle_t b)

Defined at line 426 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h

operator>=

bool operator>=(const unowned<T> & a, zx_handle_t b)

Defined at line 431 of file ../../zircon/system/ulib/zx/include/lib/zx/object.h