diff options
author | Martin Fischer <martin@push-f.com> | 2021-11-20 07:29:48 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2021-11-20 07:29:48 +0100 |
commit | 8d4c194edf32a0b94bf4eaaa562806e86cfc0d74 (patch) | |
tree | 6900e766ca9eecbf6ae11924242ae811ccdc4d32 /README.md | |
parent | d9e1b4e560d93c4245d6ffe41d4970724ede4f43 (diff) |
ignore README examples via code block attributes
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -4,7 +4,7 @@ In order for a trait to be usable as a trait object it needs to fulfill [several requirements](https://doc.rust-lang.org/reference/items/traits.html#object-safety). For example: -```rust +```rust ignore trait Client { type Error; @@ -28,7 +28,7 @@ implementations with different associated type values. This crate provides an attribute macro to achieve that. To use dynamize you only have to make some small changes: -```rust +```rust ignore #[dynamize::dynamize] trait Client { type Error: Into<SuperError>; @@ -52,7 +52,7 @@ type. For the above example dynamize generates the following code: -```rust +```rust ignore trait DynClient { fn get(&self, url: String) -> Result<Vec<u8>, SuperError>; } @@ -92,7 +92,7 @@ Dynamize supports async out of the box. Since Rust however does not yet support async functions in traits, you'll have to additionally use another library like [async-trait](https://crates.io/crates/async-trait), for example: -```rust +```rust ignore #[dynamize::dynamize] #[dyn_trait_attr(async_trait)] #[blanket_impl_attr(async_trait)] @@ -114,7 +114,7 @@ attribute. The following also just works: -```rust +```rust ignore #[dynamize::dynamize] trait TraitWithCallback { type A: SomeTrait; |