pub struct PreconditionFailure {
pub violations: Vec<PreconditionViolation>,
}Expand description
Used to encode/decode the PreconditionFailure standard error message
described in error_details.proto. Describes what preconditions have
failed.
Fields§
§violations: Vec<PreconditionViolation>Describes all precondition violations of the request.
Implementations§
Source§impl PreconditionFailure
impl PreconditionFailure
Sourcepub const TYPE_URL: &'static str = "type.googleapis.com/google.rpc.PreconditionFailure"
pub const TYPE_URL: &'static str = "type.googleapis.com/google.rpc.PreconditionFailure"
Type URL of the PreconditionFailure standard error message type.
Sourcepub fn new(violations: impl Into<Vec<PreconditionViolation>>) -> Self
pub fn new(violations: impl Into<Vec<PreconditionViolation>>) -> Self
Creates a new PreconditionFailure struct.
Sourcepub fn with_violation(
violation_type: impl Into<String>,
subject: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn with_violation( violation_type: impl Into<String>, subject: impl Into<String>, description: impl Into<String>, ) -> Self
Creates a new PreconditionFailure struct with a single
PreconditionViolation in violations.
Sourcepub fn add_violation(
&mut self,
type: impl Into<String>,
subject: impl Into<String>,
description: impl Into<String>,
) -> &mut Self
pub fn add_violation( &mut self, type: impl Into<String>, subject: impl Into<String>, description: impl Into<String>, ) -> &mut Self
Adds a PreconditionViolation to PreconditionFailure’s
violations vector.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true if PreconditionFailure’s violations vector is
empty, and false if it is not.
Trait Implementations§
Source§impl Clone for PreconditionFailure
impl Clone for PreconditionFailure
Source§fn clone(&self) -> PreconditionFailure
fn clone(&self) -> PreconditionFailure
Returns a duplicate 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 PreconditionFailure
impl Debug for PreconditionFailure
Source§impl From<PreconditionFailure> for ErrorDetail
impl From<PreconditionFailure> for ErrorDetail
Source§fn from(err_detail: PreconditionFailure) -> Self
fn from(err_detail: PreconditionFailure) -> Self
Converts to this type from the input type.
Source§impl From<PreconditionFailure> for PreconditionFailure
impl From<PreconditionFailure> for PreconditionFailure
Source§fn from(value: PreconditionFailure) -> Self
fn from(value: PreconditionFailure) -> Self
Converts to this type from the input type.
Source§impl From<PreconditionFailure> for PreconditionFailure
impl From<PreconditionFailure> for PreconditionFailure
Source§fn from(value: PreconditionFailure) -> Self
fn from(value: PreconditionFailure) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PreconditionFailure
impl RefUnwindSafe for PreconditionFailure
impl Send for PreconditionFailure
impl Sync for PreconditionFailure
impl Unpin for PreconditionFailure
impl UnwindSafe for PreconditionFailure
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> 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