pub struct ResourceLimitError { /* private fields */ }Expand description
Stable, bounded metadata for a resource exhaustion error.
Instances can only be created when observed is strictly greater than
limit. All textual fields are selected from closed enums, so error output
cannot echo attacker-controlled content.
Implementations§
Source§impl ResourceLimitError
impl ResourceLimitError
Sourcepub const CODE: &'static str = "resource_limit_exceeded"
pub const CODE: &'static str = "resource_limit_exceeded"
Stable machine-readable code for this error kind.
Sourcepub const fn exceeded(
operation: ResourceOperation,
category: ResourceCategory,
dimension: ResourceDimension,
limit: u64,
observed: u64,
stage: Option<ResourceStage>,
) -> Option<ResourceLimitError>
pub const fn exceeded( operation: ResourceOperation, category: ResourceCategory, dimension: ResourceDimension, limit: u64, observed: u64, stage: Option<ResourceStage>, ) -> Option<ResourceLimitError>
Creates metadata for a value that exceeded a finite resource limit.
pub const fn operation(self) -> ResourceOperation
pub const fn category(self) -> ResourceCategory
pub const fn dimension(self) -> ResourceDimension
pub const fn limit(self) -> u64
pub const fn observed(self) -> u64
pub const fn stage(self) -> Option<ResourceStage>
pub const fn operation_code(self) -> &'static str
pub const fn category_code(self) -> &'static str
pub const fn dimension_code(self) -> &'static str
pub const fn stage_code(self) -> Option<&'static str>
Trait Implementations§
Source§impl Clone for ResourceLimitError
impl Clone for ResourceLimitError
Source§fn clone(&self) -> ResourceLimitError
fn clone(&self) -> ResourceLimitError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ResourceLimitError
Source§impl Debug for ResourceLimitError
impl Debug for ResourceLimitError
Source§impl Display for ResourceLimitError
impl Display for ResourceLimitError
impl Eq for ResourceLimitError
Source§impl Error for ResourceLimitError
impl Error for ResourceLimitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ResourceLimitError> for Error
impl From<ResourceLimitError> for Error
Source§fn from(source: ResourceLimitError) -> Error
fn from(source: ResourceLimitError) -> Error
Converts to this type from the input type.
Source§impl Hash for ResourceLimitError
impl Hash for ResourceLimitError
Source§impl PartialEq for ResourceLimitError
impl PartialEq for ResourceLimitError
impl StructuralPartialEq for ResourceLimitError
Auto Trait Implementations§
impl Freeze for ResourceLimitError
impl RefUnwindSafe for ResourceLimitError
impl Send for ResourceLimitError
impl Sync for ResourceLimitError
impl Unpin for ResourceLimitError
impl UnsafeUnpin for ResourceLimitError
impl UnwindSafe for ResourceLimitError
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.