Skip to main content

Refusal

Enum Refusal 

Source
pub enum Refusal {
Show 17 variants NotPublished { state: LifecycleState, }, InstanceMismatch { named: String, actual: String, }, DefinitionMismatch { named: String, offered: String, }, DigestMismatch { bound: String, presented: String, }, StaleRevision { offered: u64, current: u64, }, WorkspaceMismatch { offered: String, caller: String, }, AudienceMismatch { audience: Audience, }, AssertionRequired, ExtraControl { control: String, }, DuplicateControl { control: String, }, MissingRequiredControl { control: String, }, WrongControlType { control: String, expected: &'static str, found: &'static str, }, MalformedValue { control: String, expected: String, found: String, }, UnknownOption { control: String, option: String, }, UnknownAction { option: String, }, ActionNotEligible { option: String, audience: Audience, }, Protocol(ProtocolError),
}
Expand description

Why a response was refused. Every variant is a REFUSAL: there is no variant meaning “accepted with reservations”.

Variants§

§

NotPublished

The offer is not open for answers.

Fields

§state: LifecycleState

The state the offer is actually in.

§

InstanceMismatch

The response answers a different offer.

Fields

§named: String

What the response named.

§actual: String

The offer being resolved.

§

DefinitionMismatch

The response answers a different definition than the offer binds.

Fields

§named: String

What the response named.

§offered: String

What the offer binds.

§

DigestMismatch

The definition presented is not the one the response was minted against — it changed by at least one byte.

Fields

§bound: String

The digest the response binds.

§presented: String

The digest of the definition actually presented.

§

StaleRevision

The responder answered an older revision.

Fields

§offered: u64

The revision the responder saw.

§current: u64

The revision the definition is at now.

§

WorkspaceMismatch

The offer belongs to a different workspace fence.

Fields

§offered: String

The fence on the offer.

§caller: String

The caller’s fence.

§

AudienceMismatch

The responder answered from an audience the offer is not open to.

Fields

§audience: Audience

The audience that answered.

§

AssertionRequired

The offer requires an authenticated assertion and none was presented.

§

ExtraControl

The response answers a control the definition does not offer.

Fields

§control: String

The control the response named.

§

DuplicateControl

The response answers one control twice.

Fields

§control: String

The control answered twice.

§

MissingRequiredControl

A REQUIRED control has no answer.

Fields

§control: String

The unanswered control.

§

WrongControlType

The value’s kind does not match the control’s kind.

Fields

§control: String

The control answered.

§expected: &'static str

The kind the definition declares.

§found: &'static str

The kind the value carries.

§

MalformedValue

The value is the control’s kind, but not a well-formed one of it — not-a-date for a date, 11 for a number capped at 10.

Distinct from WrongControlType on purpose: that one is a responder answering the wrong FIELD SHAPE, which is a protocol error, while this is a human typing something that is not what was asked for. A surface can correct the second inline and can do nothing about the first.

Fields

§control: String

The control answered.

§expected: String

What a well-formed answer looks like.

§found: String

What was submitted.

§

UnknownOption

The chosen option is not one the control offers.

Fields

§control: String

The control answered.

§option: String

The option chosen.

§

UnknownAction

The chosen option maps to no caller-registered handler.

Fields

§option: String

The option chosen.

§

ActionNotEligible

The action exists but this responder may not invoke it.

Fields

§option: String

The option chosen.

§audience: Audience

The audience that answered.

§

Protocol(ProtocolError)

Content addressing failed while checking a binding.

Trait Implementations§

Source§

impl Debug for Refusal

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Refusal

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Refusal

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<ProtocolError> for Refusal

Source§

fn from(source: ProtocolError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.