Asylo
Namespaces | Functions
status_helpers.h File Reference
#include <string>
#include "absl/strings/string_view.h"
#include "absl/types/optional.h"
#include "asylo/util/status.h"
#include "asylo/util/status.pb.h"
#include "asylo/util/status_helpers_internal.h"
#include "asylo/util/statusor.h"
Include dependency graph for status_helpers.h:

Go to the source code of this file.

Namespaces

 asylo
 

Functions

template<typename ToStatusT , typename FromStatusT >
ToStatusT asylo::ConvertStatus (const FromStatusT &from_status)
 Converts a status-like object to another status type. More...
 
StatusProto asylo::StatusToProto (const Status &status)
 Exports the contents of status into a StatusProto. More...
 
Status asylo::StatusFromProto (const StatusProto &status_proto)
 Returns a Status based on the contents of the given status_proto. More...
 
template<typename MessageT >
std::string asylo::GetTypeUrl ()
 Returns the type URL associated with a given protobuf message type. More...
 
template<typename MessageT , typename StatusT = Status>
absl::optional< MessageT > asylo::GetProtoPayload (const StatusT &status)
 Gets the payload of type MessageT in status. More...
 
template<typename MessageT , typename StatusT = Status>
void asylo::SetProtoPayload (const MessageT &message, StatusT &status)
 Adds a payload of type MessageT to status. More...
 
Status asylo::WithContext (const Status &status, absl::string_view context)
 Returns the Status with the provided context prepended to its error message. More...
 
template<typename T >
StatusOr< T > asylo::WithContext (StatusOr< T > status_or, absl::string_view context)
 As the Status overload above, but for StatusOr<T>. More...
 
template<typename T >
absl::StatusOr< T > asylo::WithContext (absl::StatusOr< T > status_or, absl::string_view context)
 As the StatusOr<T> overload above, but for absl::StatusOr<T>. More...