Struct tonic_types::QuotaFailure
source · pub struct QuotaFailure {
pub violations: Vec<QuotaViolation>,
}
Expand description
Used to encode/decode the QuotaFailure
standard error message described
in error_details.proto. Describes how a quota check failed.
Fields§
§violations: Vec<QuotaViolation>
Describes all quota violations.
Implementations§
source§impl QuotaFailure
impl QuotaFailure
sourcepub const TYPE_URL: &'static str = "type.googleapis.com/google.rpc.QuotaFailure"
pub const TYPE_URL: &'static str = "type.googleapis.com/google.rpc.QuotaFailure"
Type URL of the QuotaFailure
standard error message type.
sourcepub fn new(violations: impl Into<Vec<QuotaViolation>>) -> Self
pub fn new(violations: impl Into<Vec<QuotaViolation>>) -> Self
Creates a new QuotaFailure
struct.
sourcepub fn with_violation(
subject: impl Into<String>,
description: impl Into<String>
) -> Self
pub fn with_violation( subject: impl Into<String>, description: impl Into<String> ) -> Self
Creates a new QuotaFailure
struct with a single QuotaViolation
in violations
.
sourcepub fn add_violation(
&mut self,
subject: impl Into<String>,
description: impl Into<String>
) -> &mut Self
pub fn add_violation( &mut self, subject: impl Into<String>, description: impl Into<String> ) -> &mut Self
Adds a QuotaViolation
to QuotaFailure
’s violations
.
sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if QuotaFailure
’s violations
vector is empty, and
false
if it is not.
Trait Implementations§
source§impl Clone for QuotaFailure
impl Clone for QuotaFailure
source§fn clone(&self) -> QuotaFailure
fn clone(&self) -> QuotaFailure
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 QuotaFailure
impl Debug for QuotaFailure
source§impl From<QuotaFailure> for ErrorDetail
impl From<QuotaFailure> for ErrorDetail
source§fn from(err_detail: QuotaFailure) -> Self
fn from(err_detail: QuotaFailure) -> Self
Converts to this type from the input type.
source§impl From<QuotaFailure> for QuotaFailure
impl From<QuotaFailure> for QuotaFailure
source§fn from(value: QuotaFailure) -> Self
fn from(value: QuotaFailure) -> Self
Converts to this type from the input type.
source§impl From<QuotaFailure> for QuotaFailure
impl From<QuotaFailure> for QuotaFailure
source§fn from(value: QuotaFailure) -> Self
fn from(value: QuotaFailure) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for QuotaFailure
impl Send for QuotaFailure
impl Sync for QuotaFailure
impl Unpin for QuotaFailure
impl UnwindSafe for QuotaFailure
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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