pub enum Refusal {
Show 17 variants
Empty,
Reserved(Form),
WrongSample {
form: Form,
sample: SampleKind,
},
KeyKind {
form: Form,
kind: KindToken,
},
DeleteTag(Tag),
HeldTag(Tag),
RequestRun,
KeyStamp {
wide: bool,
},
Short {
need: usize,
have: usize,
},
Trailing(usize),
Cause {
code: Code,
cause: Option<Cause>,
},
Detail(Code),
Extension,
MessageShort {
need: usize,
have: usize,
},
Utf8,
Time,
Held(Stamp),
}Expand description
Why bytes are not an envelope or a form of their sample. The variants are in §7.5’s order, which is the order they are found in: CH’s checks, the stamp, a delete’s end, then an error’s byte and what follows it.
Variants§
Empty
No byte at all, so no CH.
Reserved(Form)
A form this version reserves: an event.
WrongSample
A form the sample does not carry (SampleKind::carries).
KeyKind
A frame on a key whose kind token is not stream (core 0.83), or a
snapshot on one that is neither state nor @state (core 0.97).
DeleteTag(Tag)
A delete whose tag is not 0.
HeldTag(Tag)
A held stamp whose tag is not 0 (core 0.110): on a state GET, or on a GET’s reply that is a snapshot’s envelope with no byte after its seq.
RequestRun
A request whose width bit is 1: a request carries no run (core 0.92).
KeyStamp
An event whose key’s last chunk is not an occurrence chunk of CH’s width (core 0.101): the other width’s, any other chunk, or no key at all.
Short
Fewer bytes than CH, the run and the seq need, and an error’s byte after them.
Trailing(usize)
Bytes after a delete’s seq, or after an error that ends with its message or its byte, where no detail follows.
Cause
An error’s cause on a code other than unavailable, or none on
unavailable (core 0.92).
Detail(Code)
An error’s detail on a code other than app.
Extension
An error’s extension bit set, which this version leaves 0.
MessageShort
An error’s message cut short: no length byte, or fewer bytes than it states.
Utf8
An error’s message that is not UTF-8, as RFC 3629 defines it.
Time
An event’s time with an unused code (core 0.101): an ms16 above 999, or any but 0 under a t32 of all ones.
Held(Stamp)
A held stamp that is no owner’s answer to its reader (core 0.110
§4.2, “A held stamp in answer”): one that differs from the stamp
its GET carried, one in reply to a GET that carried none, one on
another key, or one heard on a subscription. Its bytes parse (§7.5);
it establishes nothing, merges nothing, and is counted undecodable.
Not a refusal of §7.5’s parse: the reader’s, which knows what it
asked (crate::seed::Asked::read).
Implementations§
Source§impl Refusal
impl Refusal
Sourcepub const fn token(&self) -> &'static str
pub const fn token(&self) -> &'static str
The reason token spec/conformance/envelope/vectors.json,
carries.json and spec/conformance/errors/forms.json pin:
short, form, sample_kind, key_kind, tag, request_run,
key_stamp, trailing, time, cause, detail, extension or
utf8; and held, seed/held.json’s, for a held stamp that is no
answer.
Source§impl Refusal
impl Refusal
Sourcepub fn reason(&self) -> String
pub fn reason(&self) -> String
Why a refused envelope’s sample is undecodable, for a person and a
script alike: the refusal’s token after a fixed prefix,
zk2c envelope refused: short. A held stamp that is no answer
(Refusal::Held) is named as what it is, with its stamp, before
its token, held: its bytes parse, and it is no page cut short.
Trait Implementations§
impl Copy for Refusal
impl Eq for Refusal
Source§impl Error for Refusal
impl Error for Refusal
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Forget for Refusal
impl Freeze for Refusal
impl Move for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more