#[non_exhaustive]pub struct YdbStatusError {
pub message: String,
pub operation_status: i32,
pub issues: Vec<YdbIssue>,
}
Expand description
Describe operation status from server
Messages and codes doesn’t have stable gurantee. But codes more stable. If you want detect some errors prefer code over text parse. Messages for human usage only.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.message: String
Human readable message described status
operation_status: i32
Operation status code
Struct field presended as i32 - for repr any of received value For get typed status use fn YdbStatusError::operation_status()
let mut status =YdbStatusError::default();
status.operation_status = StatusCode::AlreadyExists as i32;
assert_eq!(status.operation_status, 400130);
assert_eq!(status.operation_status()?, StatusCode::AlreadyExists);
issues: Vec<YdbIssue>
Ydb issue from server for the message
It describe internal errors, warnings, etc more detail then operation_status or message.
Implementations§
Source§impl YdbStatusError
impl YdbStatusError
Sourcepub fn operation_status(&self) -> YdbResult<StatusCode>
pub fn operation_status(&self) -> YdbResult<StatusCode>
Got typed operation status or error
let mut status = YdbStatusError::default();
status.operation_status= StatusCode::AlreadyExists as i32;
assert_eq!(status.operation_status, 400130);
assert_eq!(status.operation_status()?, StatusCode::AlreadyExists);
Trait Implementations§
Source§impl Clone for YdbStatusError
impl Clone for YdbStatusError
Source§fn clone(&self) -> YdbStatusError
fn clone(&self) -> YdbStatusError
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for YdbStatusError
impl Debug for YdbStatusError
Source§impl Default for YdbStatusError
impl Default for YdbStatusError
Source§fn default() -> YdbStatusError
fn default() -> YdbStatusError
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for YdbStatusError
impl RefUnwindSafe for YdbStatusError
impl Send for YdbStatusError
impl Sync for YdbStatusError
impl Unpin for YdbStatusError
impl UnwindSafe for YdbStatusError
Blanket Implementations§
Source§impl<T> Any for T
impl<T> Any for T
Source§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request