Lines Matching full:status
48 // Returns the name for the status code, or "" if it is an unknown value.
56 // Container for status payloads.
64 // Reference-counted representation of Status data.
75 class ABSL_MUST_USE_RESULT Status final {
77 // Creates an OK status with no message or payload.
78 Status();
80 // Create a status in the canonical error space with the specified code and
82 // object identical to an OK status is constructed.
86 Status(absl::StatusCode code, absl::string_view msg);
88 Status(const Status&);
89 Status& operator=(const Status& x);
93 Status(Status&&) noexcept;
94 Status& operator=(Status&&);
96 ~Status();
99 // preserves the current data. May, in the future, augment the current status
109 void Update(const Status& new_status);
110 void Update(Status&& new_status);
112 // Returns true if the Status is OK.
128 friend bool operator==(const Status&, const Status&);
129 friend bool operator!=(const Status&, const Status&);
145 friend void swap(Status& a, Status& b);
163 // Sets the payload for `type_url` key for a non-ok status, overwriting any
166 // NOTE: Does nothing if the Status is ok.
179 // NOTE: Any mutation on the same 'Status' object during visitation is
186 friend Status CancelledError();
188 // Creates a status in the canonical error space with the specified
190 explicit Status(absl::StatusCode code);
197 // Ensures rep_ is not shared with any other Status.
206 static bool EqualsSlow(const absl::Status& a, const absl::Status& b);
210 "Status accessed after move.";
219 // Indicates whether this Status was the rhs of a move operation. See rep_
234 // Returns std::string for non-ok Status.
237 // Status supports two different representations.
248 // Returns an OK status, equivalent to a default constructed instance.
249 Status OkStatus();
252 std::ostream& operator<<(std::ostream& os, const Status& x);
257 inline Status::Status() : rep_(CodeToInlinedRep(absl::StatusCode::kOk)) {} in Status() function
259 inline Status::Status(absl::StatusCode code) : rep_(CodeToInlinedRep(code)) {} in Status() function
261 inline Status::Status(const Status& x) : rep_(x.rep_) { Ref(rep_); } in Status() function
263 inline Status& Status::operator=(const Status& x) {
273 inline Status::Status(Status&& x) noexcept : rep_(x.rep_) { in Status() function
277 inline Status& Status::operator=(Status&& x) {
285 inline void Status::Update(const Status& new_status) { in Update()
291 inline void Status::Update(Status&& new_status) { in Update()
297 inline Status::~Status() { Unref(rep_); } in ~Status()
299 inline bool Status::ok() const { in ok()
303 inline absl::string_view Status::message() const { in message()
310 inline bool operator==(const Status& lhs, const Status& rhs) {
311 return lhs.rep_ == rhs.rep_ || Status::EqualsSlow(lhs, rhs);
314 inline bool operator!=(const Status& lhs, const Status& rhs) {
318 inline std::string Status::ToString() const { in ToString()
322 inline void Status::IgnoreError() const { in IgnoreError()
326 inline void swap(absl::Status& a, absl::Status& b) { in swap()
331 inline const status_internal::Payloads* Status::GetPayloads() const { in GetPayloads()
335 inline status_internal::Payloads* Status::GetPayloads() { in GetPayloads()
339 inline bool Status::IsInlined(uintptr_t rep) { return (rep & 1) == 0; } in IsInlined()
341 inline bool Status::IsMovedFrom(uintptr_t rep) { in IsMovedFrom()
345 inline uintptr_t Status::MovedFromRep() { in MovedFromRep()
349 inline uintptr_t Status::CodeToInlinedRep(absl::StatusCode code) { in CodeToInlinedRep()
353 inline absl::StatusCode Status::InlinedRepToCode(uintptr_t rep) { in InlinedRepToCode()
358 inline status_internal::StatusRep* Status::RepToPointer(uintptr_t rep) { in RepToPointer()
363 inline uintptr_t Status::PointerToRep(status_internal::StatusRep* rep) { in PointerToRep()
367 inline void Status::Ref(uintptr_t rep) { in Ref()
373 inline void Status::Unref(uintptr_t rep) { in Unref()
379 inline Status OkStatus() { return Status(); } in OkStatus()
381 // Each of the functions below creates a Status object with a particular error
382 // code and the given message. The error code of the returned status object
384 Status AbortedError(absl::string_view message);
385 Status AlreadyExistsError(absl::string_view message);
386 Status CancelledError(absl::string_view message);
387 Status DataLossError(absl::string_view message);
388 Status DeadlineExceededError(absl::string_view message);
389 Status FailedPreconditionError(absl::string_view message);
390 Status InternalError(absl::string_view message);
391 Status InvalidArgumentError(absl::string_view message);
392 Status NotFoundError(absl::string_view message);
393 Status OutOfRangeError(absl::string_view message);
394 Status PermissionDeniedError(absl::string_view message);
395 Status ResourceExhaustedError(absl::string_view message);
396 Status UnauthenticatedError(absl::string_view message);
397 Status UnavailableError(absl::string_view message);
398 Status UnimplementedError(absl::string_view message);
399 Status UnknownError(absl::string_view message);
401 // Creates a `Status` object with the `absl::StatusCode::kCancelled` error code
404 inline Status CancelledError() { return Status(absl::StatusCode::kCancelled); } in CancelledError()
406 // Each of the functions below returns true if the given status matches the
408 ABSL_MUST_USE_RESULT bool IsAborted(const Status& status);
409 ABSL_MUST_USE_RESULT bool IsAlreadyExists(const Status& status);
410 ABSL_MUST_USE_RESULT bool IsCancelled(const Status& status);
411 ABSL_MUST_USE_RESULT bool IsDataLoss(const Status& status);
412 ABSL_MUST_USE_RESULT bool IsDeadlineExceeded(const Status& status);
413 ABSL_MUST_USE_RESULT bool IsFailedPrecondition(const Status& status);
414 ABSL_MUST_USE_RESULT bool IsInternal(const Status& status);
415 ABSL_MUST_USE_RESULT bool IsInvalidArgument(const Status& status);
416 ABSL_MUST_USE_RESULT bool IsNotFound(const Status& status);
417 ABSL_MUST_USE_RESULT bool IsOutOfRange(const Status& status);
418 ABSL_MUST_USE_RESULT bool IsPermissionDenied(const Status& status);
419 ABSL_MUST_USE_RESULT bool IsResourceExhausted(const Status& status);
420 ABSL_MUST_USE_RESULT bool IsUnauthenticated(const Status& status);
421 ABSL_MUST_USE_RESULT bool IsUnavailable(const Status& status);
422 ABSL_MUST_USE_RESULT bool IsUnimplemented(const Status& status);
423 ABSL_MUST_USE_RESULT bool IsUnknown(const Status& status);