tuple.mx raw

   1  package cm
   2  
   3  // Tuple represents a [Component Model tuple] with 2 fields.
   4  //
   5  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
   6  type Tuple[T0, T1 any] struct {
   7  	_  HostLayout
   8  	F0 T0
   9  	F1 T1
  10  }
  11  
  12  // Tuple3 represents a [Component Model tuple] with 3 fields.
  13  //
  14  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  15  type Tuple3[T0, T1, T2 any] struct {
  16  	_  HostLayout
  17  	F0 T0
  18  	F1 T1
  19  	F2 T2
  20  }
  21  
  22  // Tuple4 represents a [Component Model tuple] with 4 fields.
  23  //
  24  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  25  type Tuple4[T0, T1, T2, T3 any] struct {
  26  	_  HostLayout
  27  	F0 T0
  28  	F1 T1
  29  	F2 T2
  30  	F3 T3
  31  }
  32  
  33  // Tuple5 represents a [Component Model tuple] with 5 fields.
  34  //
  35  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  36  type Tuple5[T0, T1, T2, T3, T4 any] struct {
  37  	_  HostLayout
  38  	F0 T0
  39  	F1 T1
  40  	F2 T2
  41  	F3 T3
  42  	F4 T4
  43  }
  44  
  45  // Tuple6 represents a [Component Model tuple] with 6 fields.
  46  //
  47  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  48  type Tuple6[T0, T1, T2, T3, T4, T5 any] struct {
  49  	_  HostLayout
  50  	F0 T0
  51  	F1 T1
  52  	F2 T2
  53  	F3 T3
  54  	F4 T4
  55  	F5 T5
  56  }
  57  
  58  // Tuple7 represents a [Component Model tuple] with 7 fields.
  59  //
  60  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  61  type Tuple7[T0, T1, T2, T3, T4, T5, T6 any] struct {
  62  	_  HostLayout
  63  	F0 T0
  64  	F1 T1
  65  	F2 T2
  66  	F3 T3
  67  	F4 T4
  68  	F5 T5
  69  	F6 T6
  70  }
  71  
  72  // Tuple8 represents a [Component Model tuple] with 8 fields.
  73  //
  74  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  75  type Tuple8[T0, T1, T2, T3, T4, T5, T6, T7 any] struct {
  76  	_  HostLayout
  77  	F0 T0
  78  	F1 T1
  79  	F2 T2
  80  	F3 T3
  81  	F4 T4
  82  	F5 T5
  83  	F6 T6
  84  	F7 T7
  85  }
  86  
  87  // Tuple9 represents a [Component Model tuple] with 9 fields.
  88  //
  89  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
  90  type Tuple9[T0, T1, T2, T3, T4, T5, T6, T7, T8 any] struct {
  91  	_  HostLayout
  92  	F0 T0
  93  	F1 T1
  94  	F2 T2
  95  	F3 T3
  96  	F4 T4
  97  	F5 T5
  98  	F6 T6
  99  	F7 T7
 100  	F8 T8
 101  }
 102  
 103  // Tuple10 represents a [Component Model tuple] with 10 fields.
 104  //
 105  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 106  type Tuple10[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9 any] struct {
 107  	_  HostLayout
 108  	F0 T0
 109  	F1 T1
 110  	F2 T2
 111  	F3 T3
 112  	F4 T4
 113  	F5 T5
 114  	F6 T6
 115  	F7 T7
 116  	F8 T8
 117  	F9 T9
 118  }
 119  
 120  // Tuple11 represents a [Component Model tuple] with 11 fields.
 121  //
 122  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 123  type Tuple11[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10 any] struct {
 124  	_   HostLayout
 125  	F0  T0
 126  	F1  T1
 127  	F2  T2
 128  	F3  T3
 129  	F4  T4
 130  	F5  T5
 131  	F6  T6
 132  	F7  T7
 133  	F8  T8
 134  	F9  T9
 135  	F10 T10
 136  }
 137  
 138  // Tuple12 represents a [Component Model tuple] with 12 fields.
 139  //
 140  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 141  type Tuple12[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11 any] struct {
 142  	_   HostLayout
 143  	F0  T0
 144  	F1  T1
 145  	F2  T2
 146  	F3  T3
 147  	F4  T4
 148  	F5  T5
 149  	F6  T6
 150  	F7  T7
 151  	F8  T8
 152  	F9  T9
 153  	F10 T10
 154  	F11 T11
 155  }
 156  
 157  // Tuple13 represents a [Component Model tuple] with 13 fields.
 158  //
 159  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 160  type Tuple13[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12 any] struct {
 161  	_   HostLayout
 162  	F0  T0
 163  	F1  T1
 164  	F2  T2
 165  	F3  T3
 166  	F4  T4
 167  	F5  T5
 168  	F6  T6
 169  	F7  T7
 170  	F8  T8
 171  	F9  T9
 172  	F10 T10
 173  	F11 T11
 174  	F12 T12
 175  }
 176  
 177  // Tuple14 represents a [Component Model tuple] with 14 fields.
 178  //
 179  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 180  type Tuple14[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13 any] struct {
 181  	_   HostLayout
 182  	F0  T0
 183  	F1  T1
 184  	F2  T2
 185  	F3  T3
 186  	F4  T4
 187  	F5  T5
 188  	F6  T6
 189  	F7  T7
 190  	F8  T8
 191  	F9  T9
 192  	F10 T10
 193  	F11 T11
 194  	F12 T12
 195  	F13 T13
 196  }
 197  
 198  // Tuple15 represents a [Component Model tuple] with 15 fields.
 199  //
 200  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 201  type Tuple15[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14 any] struct {
 202  	_   HostLayout
 203  	F0  T0
 204  	F1  T1
 205  	F2  T2
 206  	F3  T3
 207  	F4  T4
 208  	F5  T5
 209  	F6  T6
 210  	F7  T7
 211  	F8  T8
 212  	F9  T9
 213  	F10 T10
 214  	F11 T11
 215  	F12 T12
 216  	F13 T13
 217  	F14 T14
 218  }
 219  
 220  // Tuple16 represents a [Component Model tuple] with 16 fields.
 221  //
 222  // [Component Model tuple]: https://component-model.bytecodealliance.org/design/wit.html#tuples
 223  type Tuple16[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15 any] struct {
 224  	_   HostLayout
 225  	F0  T0
 226  	F1  T1
 227  	F2  T2
 228  	F3  T3
 229  	F4  T4
 230  	F5  T5
 231  	F6  T6
 232  	F7  T7
 233  	F8  T8
 234  	F9  T9
 235  	F10 T10
 236  	F11 T11
 237  	F12 T12
 238  	F13 T13
 239  	F14 T14
 240  	F15 T15
 241  }
 242  
 243  // MaxTuple specifies the maximum number of fields in a Tuple* type, currently [Tuple16].
 244  // See https://github.com/WebAssembly/component-model/issues/373 for more information.
 245  const MaxTuple = 16
 246