pub enum UnfoldError {
Show 14 variants
UnknownFunction(Ident),
UnknownAccessor(Ident),
NoDeconstructor {
func: Ident,
target: String,
},
AccessorTargetMismatch {
accessor: String,
takes: String,
expected: String,
},
MultipleIdentity {
target: String,
},
Cycle {
target: String,
},
ConvertNotSingle {
func: Ident,
reason: &'static str,
},
RecordNotAccessor {
func: Ident,
},
Unsupported {
func: Ident,
reason: &'static str,
},
DuplicateLeafName {
target: String,
name: String,
},
ReservedSeparator {
name: String,
},
RootIdentityBeforeNested {
target: String,
},
ReturnTypeMismatch {
func: Ident,
declared: String,
actual: String,
},
InvalidDeclarations {
entries: Vec<UnfoldDeclError>,
},
}Expand description
Errors surfaced while resolving
Deconstructors.
Variants§
UnknownFunction(Ident)
UnknownAccessor(Ident)
NoDeconstructor
AccessorTargetMismatch
MultipleIdentity
Cycle
A nested deconstructor recurses back into a type already on the nesting
chain (A → … → A).
ConvertNotSingle
A single-value (Return) delivery on a decomposition that does not
flatten to exactly one leaf, or whose shape is Iterable.
RecordNotAccessor
A decomposer record references a function that was not declared via
.accessor.
Unsupported
A shape / record kind not yet implemented.
DuplicateLeafName
Two leaves of one deconstructor resolved to the same (literal) name. Author leaf names are explicit and emitted verbatim, so a collision is a declaration bug — never auto-resolved.
ReservedSeparator
An author-supplied leaf name contains the reserved "__" chain
separator (used internally to join nested deconstructor segments).
RootIdentityBeforeNested
An owned decomposition declared .field_self() (the root identity,
which MOVES the value) before a field that splices a nested identity
(which borrows it) — the generated Rust would not compile.
ReturnTypeMismatch
A per-fn .expand_return(expand_return!(T)…) decl whose T does not
match the function’s peeled return type.
InvalidDeclarations
Structurally invalid declaration records — empty record lists or
duplicate targets. All offenders are collected before failing
(mirrors ScanError::DeclaredNotFound).
Fields
entries: Vec<UnfoldDeclError>Trait Implementations§
Source§impl Debug for UnfoldError
impl Debug for UnfoldError
Source§impl Display for UnfoldError
impl Display for UnfoldError
Source§impl Error for UnfoldError
impl Error for UnfoldError
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()
Source§impl From<UnfoldError> for WriteRustError
impl From<UnfoldError> for WriteRustError
Source§fn from(e: UnfoldError) -> Self
fn from(e: UnfoldError) -> Self
Auto Trait Implementations§
impl !Send for UnfoldError
impl !Sync for UnfoldError
impl Freeze for UnfoldError
impl RefUnwindSafe for UnfoldError
impl Unpin for UnfoldError
impl UnsafeUnpin for UnfoldError
impl UnwindSafe for UnfoldError
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
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