pub struct RpcStatus { /* private fields */ }
Expand description
RPC result returned from the server.
Implementations
sourceimpl RpcStatus
impl RpcStatus
sourcepub fn with_message<T: Into<RpcStatusCode>>(
code: T,
message: String
) -> RpcStatus
pub fn with_message<T: Into<RpcStatusCode>>(
code: T,
message: String
) -> RpcStatus
Create a new RpcStatus
with given message.
sourcepub fn with_details<T: Into<RpcStatusCode>>(
code: T,
message: String,
details: Vec<u8>
) -> RpcStatus
pub fn with_details<T: Into<RpcStatusCode>>(
code: T,
message: String,
details: Vec<u8>
) -> RpcStatus
Create a new [RpcStats
] with code, message and details.
If using rich error model, details
should be binary message that sets code
and
message
to the same value. Or you can use into
method to do automatical
transformation if using grpcio_proto::google::rpc::Status
.
sourcepub fn code(&self) -> RpcStatusCode
pub fn code(&self) -> RpcStatusCode
Return the instance’s error code.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RpcStatus
impl Send for RpcStatus
impl Sync for RpcStatus
impl Unpin for RpcStatus
impl UnwindSafe for RpcStatus
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more