pub enum CaptureCause {
Show 24 variants
HelperDoubled,
BodyAbsent,
ClauseUnread,
ClauseUndeclared,
ClauseDoubled,
ClauseAbsent,
ReferenceUnread,
RosterUnread,
GroupUnread,
RowUnread,
MappingUnread,
PermissionUnread,
PathUnread,
ItemUnread,
OrderUnpressable,
ChoiceUnread,
ChoiceDoubled,
NameUnshadowed,
NothingChosen,
PhraseUnread,
EndpointUnknown,
NumberBeyondSeat,
NameReserved,
SeparatorDangling,
}Expand description
How one helper body’s tokens do not say a declaration its grammar admits.
Dependent checks in a declared order, so exactly one cause is true of any refused body: the attribute is found before its body is read, the body’s clauses before their values, and a value’s shape before the vocabulary that value states.
Variants§
HelperDoubled
The declaration carries the helper more than once.
BodyAbsent
The helper states no parenthesized body.
ClauseUnread
A clause is not one key and one value.
ClauseUndeclared
A clause’s key is not one this grammar declares.
ClauseDoubled
One clause is stated twice.
ClauseAbsent
A required clause is absent.
ReferenceUnread
A value written where a namespaced reference is required is not one.
RosterUnread
A value written where a bracketed roster is required is not one.
GroupUnread
A value written where a named group is required is not one.
RowUnread
A row is not one name and one clause body.
MappingUnread
A mapping is not one fact and one claim.
PermissionUnread
A permission is not one claim and one family roster.
PathUnread
A value written where a declared Rust item path is required is not one.
ItemUnread
The item the helper sits on does not state a declared order this grammar can read.
OrderUnpressable
The declared order carries fewer than two members, so no transposition of it exists.
ChoiceUnread
A choice is not one bare name.
ChoiceDoubled
One name is chosen twice.
NameUnshadowed
A chosen name is not one the shadow roster covers.
NothingChosen
The declaration chooses no name at all.
PhraseUnread
A fault phrase is not one this grammar reads.
EndpointUnknown
A phrase or a link names a node or link the declaration never declared.
NumberBeyondSeat
An authored number outruns the width of the seat it is written for.
Every numeric seat has the width its harness value declares, and the capture parses at exactly that width — because generated code cannot outsource range safety to rustc: the overflowing-literal diagnostic is suppressed inside a foreign macro expansion, and an out-of-range literal wraps silently where source-authored Rust would refuse.
NameReserved
A declared name is one the language or the generated module already owns.
A Rust keyword, or a name the rendering itself writes beside the authored ones — either would collide in the adopter’s build, inside an expansion whose lints rustc has silenced, so the name refuses here at its own token instead.
SeparatorDangling
A separator stands where no clause does.
A leading or doubled comma is a phrase the author wrote, and a reader that dropped the empty group it makes would read straight past it — so the dangling separator refuses at its own token. A trailing comma after the last clause is ordinary Rust and stays lawful.
Implementations§
Source§impl CaptureCause
impl CaptureCause
Sourcepub const fn classified(self) -> Observed
pub const fn classified(self) -> Observed
How what was observed differs from the grammar that was expected.
A clause the grammar does not declare and a value whose shape it cannot read are contract disagreements: the declaration is well formed Rust and says something this grammar does not admit. A clause that is absent is a seat that was not filled, and a clause stated twice is one key answering for two values.
Trait Implementations§
Source§impl Clone for CaptureCause
impl Clone for CaptureCause
Source§fn clone(&self) -> CaptureCause
fn clone(&self) -> CaptureCause
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more