Skip to content

Instantly share code, notes, and snippets.

@wycats
Created June 25, 2014 05:19
Show Gist options
  • Save wycats/c672b11df7a35deb3bf2 to your computer and use it in GitHub Desktop.
Save wycats/c672b11df7a35deb3bf2 to your computer and use it in GitHub Desktop.
trait Matcher<T, U> {
fn matches(&self, actual: T) -> Result<U, ()>;
fn didnt_match(&self, actual: T, failure: U) -> MatchError;
fn did_match(&self, actual: T, failure: U) -> MatchError;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment