#[non_exhaustive]pub struct RefusalDetail {
pub class: ErrorClass,
pub field: Option<String>,
pub limit: Option<u64>,
pub model: Option<String>,
pub kind: Option<String>,
pub estimate_usd: Option<Number>,
pub max_cost_usd: Option<Number>,
pub resets_at_ms: Option<u64>,
pub retry_after_ms: Option<u64>,
pub credential: Option<String>,
}Expand description
The detail of an admission refusal. Which members are present depends
on the code (see the role contract’s table); class is always present,
so a caller that meets an unknown code still knows whether to retry.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.class: ErrorClass§field: Option<String>The offending or differing request field, as a path: a map key
joined with a dot, an array index in brackets (items[2].state,
questions.urgent.type). params names the request as a whole, and
is used only when no narrower path applies. Each role contract lists
its paths.
limit: Option<u64>The limit the field exceeded, where one applies.
model: Option<String>§kind: Option<String>The kind of a catalog row that is not the role’s kind, when the row states one.
estimate_usd: Option<Number>§max_cost_usd: Option<Number>§resets_at_ms: Option<u64>§retry_after_ms: Option<u64>§credential: Option<String>On auth_failed, the id of the credential the runner presented (for
example apikey:cloudflare), when the runner knows it, so an operator
can tell which login to fix. Always an id, never the secret itself.
Implementations§
Source§impl RefusalDetail
impl RefusalDetail
pub fn new(class: ErrorClass) -> RefusalDetail
pub fn with_field(self, field: impl Into<String>) -> RefusalDetail
pub fn with_limit(self, limit: u64) -> RefusalDetail
pub fn with_model(self, model: impl Into<String>) -> RefusalDetail
pub fn with_kind(self, kind: impl Into<String>) -> RefusalDetail
pub fn with_estimate_usd(self, estimate_usd: Number) -> RefusalDetail
pub fn with_max_cost_usd(self, max_cost_usd: Number) -> RefusalDetail
pub fn with_resets_at_ms(self, resets_at_ms: u64) -> RefusalDetail
pub fn with_retry_after_ms(self, retry_after_ms: u64) -> RefusalDetail
pub fn with_credential(self, credential: impl Into<String>) -> RefusalDetail
Trait Implementations§
Source§impl Clone for RefusalDetail
impl Clone for RefusalDetail
Source§fn clone(&self) -> RefusalDetail
fn clone(&self) -> RefusalDetail
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more