Adds support for tuples in runtime-interface (#7672)

This commit is contained in:
Bastian Köcher
2020-12-06 15:14:19 +01:00
committed by GitHub
parent 4b8cee9e55
commit d9b1b14769
6 changed files with 36 additions and 3 deletions
@@ -365,7 +365,9 @@ impl<T: codec::Codec> PassBy for Option<T> {
type PassBy = Codec<Self>;
}
impl PassBy for (u32, u32, u32, u32) {
#[impl_trait_for_tuples::impl_for_tuples(30)]
#[tuple_types_no_default_trait_bound]
impl PassBy for Tuple where Self: codec::Codec {
type PassBy = Codec<Self>;
}
@@ -99,7 +99,7 @@
//! | `*const T` | `u32` | `Identity` |
//! | `Option<T>` | `u64` | `let e = v.encode();`<br><br><code>e.len() 32bit << 32 &#124; e.as_ptr() 32bit</code> |
//! | [`T where T: PassBy<PassBy=Inner>`](./pass_by#Inner) | Depends on inner | Depends on inner |
//! | [`T where T:PassBy<PassBy=Codec>`](./pass_by#Codec)|`u64`|<code>v.len() 32bit << 32 &#124;v.as_ptr() 32bit</code>|
//! | [`T where T: PassBy<PassBy=Codec>`](./pass_by#Codec)|`u64`|<code>v.len() 32bit << 32 &#124;v.as_ptr() 32bit</code>|
//!
//! `Identity` means that the value is converted directly into the corresponding FFI type.