diff options
Diffstat (limited to 'tests/tests.rs')
-rw-r--r-- | tests/tests.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/tests.rs b/tests/tests.rs index b75c605..11bf10d 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -297,3 +297,22 @@ trait OneTrait: SomeTrait { fn test(&self) -> Self::X; } + +struct SuperError; +trait Cache {} +#[dynamize::dynamize] +trait Client { + type Error: Into<SuperError>; + + fn get(&self, url: String) -> Result<Vec<u8>, Self::Error>; +} +#[dynamize::dynamize] +#[dynamized(Client)] +#[convert = |x: <Self as Client>::Error| -> SuperError {x.into()}] +trait ClientWithCache: Client { + fn get_with_cache<C: Cache>( + &self, + url: String, + cache: C, + ) -> Result<Vec<u8>, <Self as Client>::Error>; +} |