pub struct Status { /* private fields */ }
Expand description
gRPC compatible error status
Implementations§
Source§impl Status
impl Status
Sourcepub fn new(code: Code, message: impl Into<String>) -> Self
pub fn new(code: Code, message: impl Into<String>) -> Self
Create a new Status
with the associated code and message.
Sourcepub fn invalid_argument(message: impl Into<String>) -> Status
pub fn invalid_argument(message: impl Into<String>) -> Status
Construct an invalid argument status
Sourcepub fn failed_precondition(message: impl Into<String>) -> Status
pub fn failed_precondition(message: impl Into<String>) -> Status
Construct a failed precondition status, used for policy violation
Trait Implementations§
Source§impl From<ValidationError> for Status
impl From<ValidationError> for Status
Source§fn from(ve: ValidationError) -> Self
fn from(ve: ValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnwindSafe for Status
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more