From d26db33422b720822b9b24b99ddadc3ffd36d752 Mon Sep 17 00:00:00 2001 From: SoniEx2 Date: Wed, 13 Jan 2021 11:20:21 -0300 Subject: Finalize Holder design (hopefully) --- src/errors.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/errors.rs') diff --git a/src/errors.rs b/src/errors.rs index 4fc2144..ddc6a1a 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,8 +1,18 @@ pub struct PatternError; +/// Error type returned by the matcher. #[derive(Clone)] pub enum MatchError { + /// Returned if the pattern nests too deeply. StackOverflow, + /// Returned if the pattern rejects the input. ValidationError, + /// Returned if the pattern attempts an unsupported operation. + /// + /// In particular, if the PatternTypes doesn't support get or pairs for a + /// given value, this error will be returned. It can be treated as a + /// ValidationError, or as a bug in the pattern, at the user's discretion. + UnsupportedOperation, + /// Returned if an unspecified non-critical error occurred. Other } -- cgit 1.4.1