diff options
author | SoniEx2 <endermoneymod@gmail.com> | 2021-02-28 23:57:40 -0300 |
---|---|---|
committer | SoniEx2 <endermoneymod@gmail.com> | 2021-02-28 23:57:40 -0300 |
commit | f4b3c4cd2537ac983068d97270aafae7005c01a2 (patch) | |
tree | edd7c0a672f08549cc5b1b11997771d11e9dcce3 /src | |
parent | a8986f0372ff58a4584dd5379db39be0cbfcea4b (diff) |
Clean up API
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/lib.rs b/src/lib.rs index 005e9bf..3cb2198 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -127,6 +127,8 @@ mod vm; pub use pattern::Pattern; +pub use vm::Matcher; + // TODO replace with GATs /// A borrowed or owned value of various types. /// @@ -199,24 +201,14 @@ pub trait PatternTypes { /// None if this operation is unsupported for the given value. fn pairs<'b>( item: RefOwn<'b, Self::Ref, Self::Own> - ) -> Option<Box<dyn Iterator<Item=KVPair<'b, Self>> + 'b>> { - // TODO remove these default impls that only exist for testing purposes - let _ = item; - let x = None; - Some(Box::new(x.into_iter())) - } + ) -> Option<Box<dyn Iterator<Item=KVPair<'b, Self>> + 'b>>; /// Returns an optional key-value pair keyed by the given key, or None if /// this operation is unsupported for the given value. fn get<'a, 'b>( item: RefOwn<'b, Self::Ref, Self::Own>, key: RefOwn<'a, Self::Ref, Self::Own> - ) -> Option<Option<KVPair<'b, Self>>> { - // TODO remove these default impls that only exist for testing purposes - let _ = item; - let _ = key; - Some(None) - } + ) -> Option<Option<KVPair<'b, Self>>>; // TODO replace with GATs + newtypes /// Returns whether two keys/values are the same/equivalent. This must provide |