class Status

Defined at line 130 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

`Status` is a thin, zero-cost abstraction around the `pw_Status` enum. It

initializes to `pw::OkStatus()` by default and adds `ok()` and `str()`

methods. Implicit conversions are permitted between `pw_Status` and

`pw::Status`.

An OK status is created by the `pw::OkStatus()` function or by the default

`Status` constructor. Non-OK `Status` is created with a static member

function that corresponds with the status code. Example:

Code

                                    
                                        {.cpp}
                                           using pw::Status;
                                        
                                           Status OperationThatFails() {
                                              // …
                                              return Status::DataLoss();
                                           }
                                    
                                

Public Methods

Status Cancelled ()

Operation was cancelled, typically by the caller.

Defined at line 150 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status Unknown ()

Unknown error occurred. Avoid this code when possible.

Defined at line 162 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status InvalidArgument ()

Argument was malformed; e.g. invalid characters when parsing integer.

Defined at line 175 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status DeadlineExceeded ()

Deadline passed before operation completed.

Defined at line 188 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status NotFound ()

The entity that the caller requested (e.g. file or directory) is not

found.

Defined at line 201 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status AlreadyExists ()

The entity that the caller requested to create is already present.

Defined at line 214 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status PermissionDenied ()

Caller lacks permission to execute action.

Defined at line 227 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status ResourceExhausted ()

Insufficient resources to complete operation; e.g. supplied buffer is too

small.

Defined at line 241 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status FailedPrecondition ()

System isn’t in the required state; e.g. deleting a non-empty directory.

Defined at line 254 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status Aborted ()

Operation aborted due to e.g. concurrency issue or failed transaction.

Defined at line 266 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status OutOfRange ()

Operation attempted out of range; e.g. seeking past end of file.

Defined at line 278 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status Unimplemented ()

Operation isn’t implemented or supported.

Defined at line 291 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status Internal ()

Internal error occurred; e.g. system invariants were violated.

Defined at line 303 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status Unavailable ()

Requested operation can’t finish now, but may at a later time.

Defined at line 315 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status DataLoss ()

Unrecoverable data loss occurred while completing the requested operation.

Defined at line 327 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status Unauthenticated ()

Caller does not have valid authentication credentials for the operation.

Defined at line 340 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

void Status (Code code)

Statuses are created with a `Status::Code`.

C/C++ interoperability: allow implicit conversion from pw_Status

Defined at line 347 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

void Status (const Status & )

Defined at line 349 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status & operator= (const Status & )

Defined at line 350 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

void Status (Status && )

Defined at line 351 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

Status & operator= (Status && )

Defined at line 352 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsCancelled ()

Defined at line 355 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsUnknown ()

Defined at line 359 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsInvalidArgument ()

Defined at line 363 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsDeadlineExceeded ()

Defined at line 367 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsNotFound ()

Defined at line 371 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsAlreadyExists ()

Defined at line 375 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsPermissionDenied ()

Defined at line 379 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsResourceExhausted ()

Defined at line 383 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsFailedPrecondition ()

Defined at line 387 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsAborted ()

Defined at line 391 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsOutOfRange ()

Defined at line 395 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsUnimplemented ()

Defined at line 399 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsInternal ()

Defined at line 403 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsUnavailable ()

Defined at line 407 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsDataLoss ()

Defined at line 411 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h

bool IsUnauthenticated ()

Defined at line 415 of file ../../third_party/pigweed/src/pw_status/public/pw_status/status.h