# <a id="guest"></a>World guest

Aggregate imports for components running inside Tarantool.

Consumers may include this world for the complete host API or import
individual interfaces directly to keep their contract minimal.

 - Imports:
    - interface `tarantool:tarantool/types@0.2.0`
    - interface `tarantool:tarantool/metrics@0.2.0`
    - interface `tarantool:tarantool/msgpack@0.2.0`
    - interface `tarantool:tarantool/database@0.2.0`
    - interface `tarantool:tarantool/log@0.2.0`
    - interface `tarantool:tarantool/error@0.2.0`
    - interface `tarantool:tarantool/session@0.2.0`
    - interface `tarantool:tarantool/transaction@0.2.0`
    - interface `tarantool:tarantool/index@0.2.0`
    - interface `tarantool:tarantool/sequence@0.2.0`
    - interface `tarantool:tarantool/key-def@0.2.0`
    - interface `tarantool:tarantool/tuple-format@0.2.0`
    - interface `tarantool:tarantool/box-tuple@0.2.0`

## <a id="tarantool_tarantool_types_0_2_0"></a>Import interface tarantool:tarantool/types@0.2.0



----

### Types

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>Exactly one complete MessagePack value encoded as bytes.

The byte sequence must contain one value and no trailing bytes. Functions
further constrain its shape where required, for example to an array or a
map. Values returned by the host are copied into guest-owned memory.

#### <a id="error_code"></a>`type error-code`
`u32`
<p>Numeric Tarantool error code.

This is the original unsigned code reported by Tarantool, including codes
unknown to this version of the WIT package. Consumers must preserve and
accept any `u32` value. Symbolic `ER_*` names belong to the Tarantool
version that produced the error and are not part of this contract.

#### <a id="box_error"></a>`record box-error`

Represents an error returned by Tarantool operations.

The numeric code is preserved exactly as reported by Tarantool. Consumers
must handle codes they do not recognize. No closed error category is
included because Tarantool's error set and classifications may evolve.

##### Record Fields

- <a id="box_error.code"></a>`code`: [`error-code`](#error_code)
  <p>Raw IPROTO or internal Tarantool error code.

- <a id="box_error.message"></a>`message`: `string`
  <p>Human-readable error message.

- <a id="box_error.error_type"></a>`error-type`: `string`
  <p>Host-provided error type, for example "ClientError" or "SocketError".

- <a id="box_error.file"></a>`file`: option<`string`>
  <p>Source file where the error originated (if available).

- <a id="box_error.line"></a>`line`: option<`u32`>
  <p>Line number in the source file where the error was raised.


#### <a id="space"></a>`record space`

Identifies a Tarantool space by its numeric ID.

##### Record Fields

- <a id="space.id"></a>`id`: `u32`
  <p>Unique identifier of the space.


#### <a id="index"></a>`record index`

Identifies a Tarantool index and its parent space.

##### Record Fields

- <a id="index.id"></a>`id`: `u32`
  <p>Index ID within its parent space.

- <a id="index.space_id"></a>`space-id`: `u32`
  <p>Numeric ID of the parent space.


#### <a id="log_context"></a>`record log-context`

Optional guest source location attached to a log message.

##### Record Fields

- <a id="log_context.file"></a>`file`: `string`
  <p>Name of the source file generating the log.

- <a id="log_context.line"></a>`line`: `u32`
  <p>Line number in the source file generating the log.


#### <a id="log_level"></a>`enum log-level`

Defines the severity levels used in Tarantool logging.

See <https://www.tarantool.io/en/doc/latest/reference/reference_capi/say/>.

##### Enum Cases

- <a id="log_level.error"></a>`error`
  <p>Recoverable error.

- <a id="log_level.critical"></a>`critical`
  <p>Severe error.

- <a id="log_level.warning"></a>`warning`
  <p>Warning.

- <a id="log_level.info"></a>`info`
  <p>Informational message.

- <a id="log_level.verbose"></a>`verbose`
  <p>Verbose message.

- <a id="log_level.debug"></a>`debug`
  <p>Debug-level message.


#### <a id="session"></a>`record session`

Represents a client session in Tarantool by its ID.

##### Record Fields

- <a id="session.id"></a>`id`: `u64`
  <p>Unique session identifier.


#### <a id="transaction_isolation"></a>`enum transaction-isolation`

Isolation levels available for Tarantool transactions.

##### Enum Cases

- <a id="transaction_isolation.default"></a>`default`
  <p>Use Tarantool's configured default isolation level.

- <a id="transaction_isolation.best_effort"></a>`best-effort`
  <p>Let Tarantool choose the isolation level for the transaction.

- <a id="transaction_isolation.read_committed"></a>`read-committed`
  <p>Read only committed, but not unconfirmed changes.

- <a id="transaction_isolation.read_confirmed"></a>`read-confirmed`
  <p>Read only confirmed changes.

- <a id="transaction_isolation.linearizable"></a>`linearizable`
  <p>Read only changes confirmed on any cluster node.


#### <a id="iterator_type"></a>`enum iterator-type`

Iterator types for index scans in Tarantool.

See <https://www.tarantool.io/en/doc/latest/reference/reference_capi/box_index/>.

##### Enum Cases

- <a id="iterator_type.equal"></a>`equal`
  <p>Equal.

- <a id="iterator_type.reverse_equal"></a>`reverse-equal`
  <p>Reverse equal.

- <a id="iterator_type.all"></a>`all`
  <p>Full scan (all tuples).

- <a id="iterator_type.less_than"></a>`less-than`
  <p>Less than.

- <a id="iterator_type.less_than_or_equal"></a>`less-than-or-equal`
  <p>Less than or equal.

- <a id="iterator_type.greater_than_or_equal"></a>`greater-than-or-equal`
  <p>Greater than or equal.

- <a id="iterator_type.greater_than"></a>`greater-than`
  <p>Greater than.

- <a id="iterator_type.bits_all_set"></a>`bits-all-set`
  <p>Bitmask: all bits set.

- <a id="iterator_type.bits_any_set"></a>`bits-any-set`
  <p>Bitmask: any bit set.

- <a id="iterator_type.bits_all_not_set"></a>`bits-all-not-set`
  <p>Bitmask: all bits not set.

- <a id="iterator_type.overlaps"></a>`overlaps`
  <p>Range overlaps.

- <a id="iterator_type.neighbor"></a>`neighbor`
  <p>Spatial index neighbor.

- <a id="iterator_type.next_prefix"></a>`next-prefix`
  <p>Next prefix in ascending order.

- <a id="iterator_type.previous_prefix"></a>`previous-prefix`
  <p>Previous prefix in descending order.


#### <a id="sequence"></a>`record sequence`

Identifies a sequence that already exists in Tarantool.

The WIT interface changes sequence state but does not create schema
objects. See
<https://www.tarantool.io/en/doc/latest/platform/ddl_dml/sequences/>.

##### Record Fields

- <a id="sequence.id"></a>`id`: `u32`
  <p>Numeric identifier of the sequence in Tarantool.


#### <a id="key_part_flags"></a>`flags key-part-flags`

Flags used to modify behavior of key parts in index definitions.

##### Flags members

- <a id="key_part_flags.is_nullable"></a>`is-nullable`: 
  <p>Allows NULL values in this key part.

- <a id="key_part_flags.exclude_null"></a>`exclude-null`: 
  <p>Exclude NULL values when comparing key parts.


#### <a id="collation"></a>`enum collation`

Built-in Tarantool collation identifiers supported by this contract.

Case ordinals correspond to the built-in IDs in Tarantool's `_collation`
system space. User-defined collations are outside this closed enum.

##### Enum Cases

- <a id="collation.none"></a>`none`
- <a id="collation.unicode"></a>`unicode`
  <p>0

- <a id="collation.unicode_ci"></a>`unicode-ci`
  <p>1

- <a id="collation.binary"></a>`binary`
  <p>2

- <a id="collation.unicode_af_s1"></a>`unicode-af-s1`
  <p>3

- <a id="collation.unicode_af_s2"></a>`unicode-af-s2`
  <p>4

- <a id="collation.unicode_af_s3"></a>`unicode-af-s3`
  <p>5

- <a id="collation.unicode_am_s1"></a>`unicode-am-s1`
  <p>6

- <a id="collation.unicode_am_s2"></a>`unicode-am-s2`
  <p>7

- <a id="collation.unicode_am_s3"></a>`unicode-am-s3`
  <p>8

- <a id="collation.unicode_ar_s1"></a>`unicode-ar-s1`
  <p>9

- <a id="collation.unicode_ar_s2"></a>`unicode-ar-s2`
  <p>10

- <a id="collation.unicode_ar_s3"></a>`unicode-ar-s3`
  <p>11

- <a id="collation.unicode_as_s1"></a>`unicode-as-s1`
  <p>12

- <a id="collation.unicode_as_s2"></a>`unicode-as-s2`
  <p>13

- <a id="collation.unicode_as_s3"></a>`unicode-as-s3`
  <p>14

- <a id="collation.unicode_az_s1"></a>`unicode-az-s1`
  <p>15

- <a id="collation.unicode_az_s2"></a>`unicode-az-s2`
  <p>16

- <a id="collation.unicode_az_s3"></a>`unicode-az-s3`
  <p>17

- <a id="collation.unicode_be_s1"></a>`unicode-be-s1`
  <p>18

- <a id="collation.unicode_be_s2"></a>`unicode-be-s2`
  <p>19

- <a id="collation.unicode_be_s3"></a>`unicode-be-s3`
  <p>20

- <a id="collation.unicode_bn_s1"></a>`unicode-bn-s1`
  <p>21

- <a id="collation.unicode_bn_s2"></a>`unicode-bn-s2`
  <p>22

- <a id="collation.unicode_bn_s3"></a>`unicode-bn-s3`
  <p>23

- <a id="collation.unicode_bs_s1"></a>`unicode-bs-s1`
  <p>24

- <a id="collation.unicode_bs_s2"></a>`unicode-bs-s2`
  <p>25

- <a id="collation.unicode_bs_s3"></a>`unicode-bs-s3`
  <p>26

- <a id="collation.unicode_bs_cyrl_s1"></a>`unicode-bs-cyrl-s1`
  <p>27

- <a id="collation.unicode_bs_cyrl_s2"></a>`unicode-bs-cyrl-s2`
  <p>28

- <a id="collation.unicode_bs_cyrl_s3"></a>`unicode-bs-cyrl-s3`
  <p>29

- <a id="collation.unicode_ca_s1"></a>`unicode-ca-s1`
  <p>30

- <a id="collation.unicode_ca_s2"></a>`unicode-ca-s2`
  <p>31

- <a id="collation.unicode_ca_s3"></a>`unicode-ca-s3`
  <p>32

- <a id="collation.unicode_cs_s1"></a>`unicode-cs-s1`
  <p>33

- <a id="collation.unicode_cs_s2"></a>`unicode-cs-s2`
  <p>34

- <a id="collation.unicode_cs_s3"></a>`unicode-cs-s3`
  <p>35

- <a id="collation.unicode_cy_s1"></a>`unicode-cy-s1`
  <p>36

- <a id="collation.unicode_cy_s2"></a>`unicode-cy-s2`
  <p>37

- <a id="collation.unicode_cy_s3"></a>`unicode-cy-s3`
  <p>38

- <a id="collation.unicode_da_s1"></a>`unicode-da-s1`
  <p>39

- <a id="collation.unicode_da_s2"></a>`unicode-da-s2`
  <p>40

- <a id="collation.unicode_da_s3"></a>`unicode-da-s3`
  <p>41

- <a id="collation.unicode_de_phonebook_s1"></a>`unicode-de-phonebook-s1`
  <p>42

- <a id="collation.unicode_de_phonebook_s2"></a>`unicode-de-phonebook-s2`
  <p>43 (de__phonebook)

- <a id="collation.unicode_de_phonebook_s3"></a>`unicode-de-phonebook-s3`
  <p>44

- <a id="collation.unicode_de_at_phonebook_s1"></a>`unicode-de-at-phonebook-s1`
  <p>45

- <a id="collation.unicode_de_at_phonebook_s2"></a>`unicode-de-at-phonebook-s2`
  <p>46

- <a id="collation.unicode_de_at_phonebook_s3"></a>`unicode-de-at-phonebook-s3`
  <p>47

- <a id="collation.unicode_dsb_s1"></a>`unicode-dsb-s1`
  <p>48

- <a id="collation.unicode_dsb_s2"></a>`unicode-dsb-s2`
  <p>49

- <a id="collation.unicode_dsb_s3"></a>`unicode-dsb-s3`
  <p>50

- <a id="collation.unicode_ee_s1"></a>`unicode-ee-s1`
  <p>51

- <a id="collation.unicode_ee_s2"></a>`unicode-ee-s2`
  <p>52

- <a id="collation.unicode_ee_s3"></a>`unicode-ee-s3`
  <p>53

- <a id="collation.unicode_eo_s1"></a>`unicode-eo-s1`
  <p>54

- <a id="collation.unicode_eo_s2"></a>`unicode-eo-s2`
  <p>55

- <a id="collation.unicode_eo_s3"></a>`unicode-eo-s3`
  <p>56

- <a id="collation.unicode_es_s1"></a>`unicode-es-s1`
  <p>57

- <a id="collation.unicode_es_s2"></a>`unicode-es-s2`
  <p>58

- <a id="collation.unicode_es_s3"></a>`unicode-es-s3`
  <p>59

- <a id="collation.unicode_es_traditional_s1"></a>`unicode-es-traditional-s1`
  <p>60

- <a id="collation.unicode_es_traditional_s2"></a>`unicode-es-traditional-s2`
  <p>61 (es__traditional)

- <a id="collation.unicode_es_traditional_s3"></a>`unicode-es-traditional-s3`
  <p>62

- <a id="collation.unicode_et_s1"></a>`unicode-et-s1`
  <p>63

- <a id="collation.unicode_et_s2"></a>`unicode-et-s2`
  <p>64

- <a id="collation.unicode_et_s3"></a>`unicode-et-s3`
  <p>65

- <a id="collation.unicode_fa_s1"></a>`unicode-fa-s1`
  <p>66

- <a id="collation.unicode_fa_s2"></a>`unicode-fa-s2`
  <p>67

- <a id="collation.unicode_fa_s3"></a>`unicode-fa-s3`
  <p>68

- <a id="collation.unicode_fi_s1"></a>`unicode-fi-s1`
  <p>69

- <a id="collation.unicode_fi_s2"></a>`unicode-fi-s2`
  <p>70

- <a id="collation.unicode_fi_s3"></a>`unicode-fi-s3`
  <p>71

- <a id="collation.unicode_fi_phonebook_s1"></a>`unicode-fi-phonebook-s1`
  <p>72

- <a id="collation.unicode_fi_phonebook_s2"></a>`unicode-fi-phonebook-s2`
  <p>73 (fi__phonebook)

- <a id="collation.unicode_fi_phonebook_s3"></a>`unicode-fi-phonebook-s3`
  <p>74

- <a id="collation.unicode_fil_s1"></a>`unicode-fil-s1`
  <p>75

- <a id="collation.unicode_fil_s2"></a>`unicode-fil-s2`
  <p>76

- <a id="collation.unicode_fil_s3"></a>`unicode-fil-s3`
  <p>77

- <a id="collation.unicode_fo_s1"></a>`unicode-fo-s1`
  <p>78

- <a id="collation.unicode_fo_s2"></a>`unicode-fo-s2`
  <p>79

- <a id="collation.unicode_fo_s3"></a>`unicode-fo-s3`
  <p>80

- <a id="collation.unicode_fr_ca_s1"></a>`unicode-fr-ca-s1`
  <p>81

- <a id="collation.unicode_fr_ca_s2"></a>`unicode-fr-ca-s2`
  <p>82

- <a id="collation.unicode_fr_ca_s3"></a>`unicode-fr-ca-s3`
  <p>83

- <a id="collation.unicode_gu_s1"></a>`unicode-gu-s1`
  <p>84

- <a id="collation.unicode_gu_s2"></a>`unicode-gu-s2`
  <p>85

- <a id="collation.unicode_gu_s3"></a>`unicode-gu-s3`
  <p>86

- <a id="collation.unicode_ha_s1"></a>`unicode-ha-s1`
  <p>87

- <a id="collation.unicode_ha_s2"></a>`unicode-ha-s2`
  <p>88

- <a id="collation.unicode_ha_s3"></a>`unicode-ha-s3`
  <p>89

- <a id="collation.unicode_haw_s1"></a>`unicode-haw-s1`
  <p>90

- <a id="collation.unicode_haw_s2"></a>`unicode-haw-s2`
  <p>91

- <a id="collation.unicode_haw_s3"></a>`unicode-haw-s3`
  <p>92

- <a id="collation.unicode_he_s1"></a>`unicode-he-s1`
  <p>93

- <a id="collation.unicode_he_s2"></a>`unicode-he-s2`
  <p>94

- <a id="collation.unicode_he_s3"></a>`unicode-he-s3`
  <p>95

- <a id="collation.unicode_hi_s1"></a>`unicode-hi-s1`
  <p>96

- <a id="collation.unicode_hi_s2"></a>`unicode-hi-s2`
  <p>97

- <a id="collation.unicode_hi_s3"></a>`unicode-hi-s3`
  <p>98

- <a id="collation.unicode_hr_s1"></a>`unicode-hr-s1`
  <p>99

- <a id="collation.unicode_hr_s2"></a>`unicode-hr-s2`
  <p>100

- <a id="collation.unicode_hr_s3"></a>`unicode-hr-s3`
  <p>101

- <a id="collation.unicode_hu_s1"></a>`unicode-hu-s1`
  <p>102

- <a id="collation.unicode_hu_s2"></a>`unicode-hu-s2`
  <p>103

- <a id="collation.unicode_hu_s3"></a>`unicode-hu-s3`
  <p>104

- <a id="collation.unicode_hy_s1"></a>`unicode-hy-s1`
  <p>105

- <a id="collation.unicode_hy_s2"></a>`unicode-hy-s2`
  <p>106

- <a id="collation.unicode_hy_s3"></a>`unicode-hy-s3`
  <p>107

- <a id="collation.unicode_ig_s1"></a>`unicode-ig-s1`
  <p>108

- <a id="collation.unicode_ig_s2"></a>`unicode-ig-s2`
  <p>109

- <a id="collation.unicode_ig_s3"></a>`unicode-ig-s3`
  <p>110

- <a id="collation.unicode_is_s1"></a>`unicode-is-s1`
  <p>111

- <a id="collation.unicode_is_s2"></a>`unicode-is-s2`
  <p>112

- <a id="collation.unicode_is_s3"></a>`unicode-is-s3`
  <p>113

- <a id="collation.unicode_ja_s1"></a>`unicode-ja-s1`
  <p>114

- <a id="collation.unicode_ja_s2"></a>`unicode-ja-s2`
  <p>115

- <a id="collation.unicode_ja_s3"></a>`unicode-ja-s3`
  <p>116

- <a id="collation.unicode_kk_s1"></a>`unicode-kk-s1`
  <p>117

- <a id="collation.unicode_kk_s2"></a>`unicode-kk-s2`
  <p>118

- <a id="collation.unicode_kk_s3"></a>`unicode-kk-s3`
  <p>119

- <a id="collation.unicode_kl_s1"></a>`unicode-kl-s1`
  <p>120

- <a id="collation.unicode_kl_s2"></a>`unicode-kl-s2`
  <p>121

- <a id="collation.unicode_kl_s3"></a>`unicode-kl-s3`
  <p>122

- <a id="collation.unicode_kn_s1"></a>`unicode-kn-s1`
  <p>123

- <a id="collation.unicode_kn_s2"></a>`unicode-kn-s2`
  <p>124

- <a id="collation.unicode_kn_s3"></a>`unicode-kn-s3`
  <p>125

- <a id="collation.unicode_ko_s1"></a>`unicode-ko-s1`
  <p>126

- <a id="collation.unicode_ko_s2"></a>`unicode-ko-s2`
  <p>127

- <a id="collation.unicode_ko_s3"></a>`unicode-ko-s3`
  <p>128

- <a id="collation.unicode_kok_s1"></a>`unicode-kok-s1`
  <p>129

- <a id="collation.unicode_kok_s2"></a>`unicode-kok-s2`
  <p>130

- <a id="collation.unicode_kok_s3"></a>`unicode-kok-s3`
  <p>131

- <a id="collation.unicode_ky_s1"></a>`unicode-ky-s1`
  <p>132

- <a id="collation.unicode_ky_s2"></a>`unicode-ky-s2`
  <p>133

- <a id="collation.unicode_ky_s3"></a>`unicode-ky-s3`
  <p>134

- <a id="collation.unicode_lkt_s1"></a>`unicode-lkt-s1`
  <p>135

- <a id="collation.unicode_lkt_s2"></a>`unicode-lkt-s2`
  <p>136

- <a id="collation.unicode_lkt_s3"></a>`unicode-lkt-s3`
  <p>137

- <a id="collation.unicode_ln_s1"></a>`unicode-ln-s1`
  <p>138

- <a id="collation.unicode_ln_s2"></a>`unicode-ln-s2`
  <p>139

- <a id="collation.unicode_ln_s3"></a>`unicode-ln-s3`
  <p>140

- <a id="collation.unicode_lt_s1"></a>`unicode-lt-s1`
  <p>141

- <a id="collation.unicode_lt_s2"></a>`unicode-lt-s2`
  <p>142

- <a id="collation.unicode_lt_s3"></a>`unicode-lt-s3`
  <p>143

- <a id="collation.unicode_lv_s1"></a>`unicode-lv-s1`
  <p>144

- <a id="collation.unicode_lv_s2"></a>`unicode-lv-s2`
  <p>145

- <a id="collation.unicode_lv_s3"></a>`unicode-lv-s3`
  <p>146

- <a id="collation.unicode_mk_s1"></a>`unicode-mk-s1`
  <p>147

- <a id="collation.unicode_mk_s2"></a>`unicode-mk-s2`
  <p>148

- <a id="collation.unicode_mk_s3"></a>`unicode-mk-s3`
  <p>149

- <a id="collation.unicode_ml_s1"></a>`unicode-ml-s1`
  <p>150

- <a id="collation.unicode_ml_s2"></a>`unicode-ml-s2`
  <p>151

- <a id="collation.unicode_ml_s3"></a>`unicode-ml-s3`
  <p>152

- <a id="collation.unicode_mr_s1"></a>`unicode-mr-s1`
  <p>153

- <a id="collation.unicode_mr_s2"></a>`unicode-mr-s2`
  <p>154

- <a id="collation.unicode_mr_s3"></a>`unicode-mr-s3`
  <p>155

- <a id="collation.unicode_mt_s1"></a>`unicode-mt-s1`
  <p>156

- <a id="collation.unicode_mt_s2"></a>`unicode-mt-s2`
  <p>157

- <a id="collation.unicode_mt_s3"></a>`unicode-mt-s3`
  <p>158

- <a id="collation.unicode_nb_s1"></a>`unicode-nb-s1`
  <p>159

- <a id="collation.unicode_nb_s2"></a>`unicode-nb-s2`
  <p>160

- <a id="collation.unicode_nb_s3"></a>`unicode-nb-s3`
  <p>161

- <a id="collation.unicode_nn_s1"></a>`unicode-nn-s1`
  <p>162

- <a id="collation.unicode_nn_s2"></a>`unicode-nn-s2`
  <p>163

- <a id="collation.unicode_nn_s3"></a>`unicode-nn-s3`
  <p>164

- <a id="collation.unicode_nso_s1"></a>`unicode-nso-s1`
  <p>165

- <a id="collation.unicode_nso_s2"></a>`unicode-nso-s2`
  <p>166

- <a id="collation.unicode_nso_s3"></a>`unicode-nso-s3`
  <p>167

- <a id="collation.unicode_om_s1"></a>`unicode-om-s1`
  <p>168

- <a id="collation.unicode_om_s2"></a>`unicode-om-s2`
  <p>169

- <a id="collation.unicode_om_s3"></a>`unicode-om-s3`
  <p>170

- <a id="collation.unicode_or_s1"></a>`unicode-or-s1`
  <p>171

- <a id="collation.unicode_or_s2"></a>`unicode-or-s2`
  <p>172

- <a id="collation.unicode_or_s3"></a>`unicode-or-s3`
  <p>173

- <a id="collation.unicode_pa_s1"></a>`unicode-pa-s1`
  <p>174

- <a id="collation.unicode_pa_s2"></a>`unicode-pa-s2`
  <p>175

- <a id="collation.unicode_pa_s3"></a>`unicode-pa-s3`
  <p>176

- <a id="collation.unicode_pl_s1"></a>`unicode-pl-s1`
  <p>177

- <a id="collation.unicode_pl_s2"></a>`unicode-pl-s2`
  <p>178

- <a id="collation.unicode_pl_s3"></a>`unicode-pl-s3`
  <p>179

- <a id="collation.unicode_ro_s1"></a>`unicode-ro-s1`
  <p>180

- <a id="collation.unicode_ro_s2"></a>`unicode-ro-s2`
  <p>181

- <a id="collation.unicode_ro_s3"></a>`unicode-ro-s3`
  <p>182

- <a id="collation.unicode_sa_s1"></a>`unicode-sa-s1`
  <p>183

- <a id="collation.unicode_sa_s2"></a>`unicode-sa-s2`
  <p>184

- <a id="collation.unicode_sa_s3"></a>`unicode-sa-s3`
  <p>185

- <a id="collation.unicode_se_s1"></a>`unicode-se-s1`
  <p>186

- <a id="collation.unicode_se_s2"></a>`unicode-se-s2`
  <p>187

- <a id="collation.unicode_se_s3"></a>`unicode-se-s3`
  <p>188

- <a id="collation.unicode_si_s1"></a>`unicode-si-s1`
  <p>189

- <a id="collation.unicode_si_s2"></a>`unicode-si-s2`
  <p>190

- <a id="collation.unicode_si_s3"></a>`unicode-si-s3`
  <p>191

- <a id="collation.unicode_si_dictionary_s1"></a>`unicode-si-dictionary-s1`
  <p>192

- <a id="collation.unicode_si_dictionary_s2"></a>`unicode-si-dictionary-s2`
  <p>193 (si__dictionary)

- <a id="collation.unicode_si_dictionary_s3"></a>`unicode-si-dictionary-s3`
  <p>194

- <a id="collation.unicode_sk_s1"></a>`unicode-sk-s1`
  <p>195

- <a id="collation.unicode_sk_s2"></a>`unicode-sk-s2`
  <p>196

- <a id="collation.unicode_sk_s3"></a>`unicode-sk-s3`
  <p>197

- <a id="collation.unicode_sl_s1"></a>`unicode-sl-s1`
  <p>198

- <a id="collation.unicode_sl_s2"></a>`unicode-sl-s2`
  <p>199

- <a id="collation.unicode_sl_s3"></a>`unicode-sl-s3`
  <p>200

- <a id="collation.unicode_sq_s1"></a>`unicode-sq-s1`
  <p>201

- <a id="collation.unicode_sq_s2"></a>`unicode-sq-s2`
  <p>202

- <a id="collation.unicode_sq_s3"></a>`unicode-sq-s3`
  <p>203

- <a id="collation.unicode_sr_s1"></a>`unicode-sr-s1`
  <p>204

- <a id="collation.unicode_sr_s2"></a>`unicode-sr-s2`
  <p>205

- <a id="collation.unicode_sr_s3"></a>`unicode-sr-s3`
  <p>206

- <a id="collation.unicode_sr_latn_s1"></a>`unicode-sr-latn-s1`
  <p>207

- <a id="collation.unicode_sr_latn_s2"></a>`unicode-sr-latn-s2`
  <p>208

- <a id="collation.unicode_sr_latn_s3"></a>`unicode-sr-latn-s3`
  <p>209

- <a id="collation.unicode_sv_s1"></a>`unicode-sv-s1`
  <p>210

- <a id="collation.unicode_sv_s2"></a>`unicode-sv-s2`
  <p>211

- <a id="collation.unicode_sv_s3"></a>`unicode-sv-s3`
  <p>212

- <a id="collation.unicode_sv_reformed_s1"></a>`unicode-sv-reformed-s1`
  <p>213

- <a id="collation.unicode_sv_reformed_s2"></a>`unicode-sv-reformed-s2`
  <p>214 (sv__reformed)

- <a id="collation.unicode_sv_reformed_s3"></a>`unicode-sv-reformed-s3`
  <p>215

- <a id="collation.unicode_ta_s1"></a>`unicode-ta-s1`
  <p>216

- <a id="collation.unicode_ta_s2"></a>`unicode-ta-s2`
  <p>217

- <a id="collation.unicode_ta_s3"></a>`unicode-ta-s3`
  <p>218

- <a id="collation.unicode_te_s1"></a>`unicode-te-s1`
  <p>219

- <a id="collation.unicode_te_s2"></a>`unicode-te-s2`
  <p>220

- <a id="collation.unicode_te_s3"></a>`unicode-te-s3`
  <p>221

- <a id="collation.unicode_th_s1"></a>`unicode-th-s1`
  <p>222

- <a id="collation.unicode_th_s2"></a>`unicode-th-s2`
  <p>223

- <a id="collation.unicode_th_s3"></a>`unicode-th-s3`
  <p>224

- <a id="collation.unicode_tn_s1"></a>`unicode-tn-s1`
  <p>225

- <a id="collation.unicode_tn_s2"></a>`unicode-tn-s2`
  <p>226

- <a id="collation.unicode_tn_s3"></a>`unicode-tn-s3`
  <p>227

- <a id="collation.unicode_to_s1"></a>`unicode-to-s1`
  <p>228

- <a id="collation.unicode_to_s2"></a>`unicode-to-s2`
  <p>229

- <a id="collation.unicode_to_s3"></a>`unicode-to-s3`
  <p>230

- <a id="collation.unicode_tr_s1"></a>`unicode-tr-s1`
  <p>231

- <a id="collation.unicode_tr_s2"></a>`unicode-tr-s2`
  <p>232

- <a id="collation.unicode_tr_s3"></a>`unicode-tr-s3`
  <p>233

- <a id="collation.unicode_ug_cyrl_s1"></a>`unicode-ug-cyrl-s1`
  <p>234

- <a id="collation.unicode_ug_cyrl_s2"></a>`unicode-ug-cyrl-s2`
  <p>235

- <a id="collation.unicode_ug_cyrl_s3"></a>`unicode-ug-cyrl-s3`
  <p>236

- <a id="collation.unicode_uk_s1"></a>`unicode-uk-s1`
  <p>237

- <a id="collation.unicode_uk_s2"></a>`unicode-uk-s2`
  <p>238

- <a id="collation.unicode_uk_s3"></a>`unicode-uk-s3`
  <p>239

- <a id="collation.unicode_ur_s1"></a>`unicode-ur-s1`
  <p>240

- <a id="collation.unicode_ur_s2"></a>`unicode-ur-s2`
  <p>241

- <a id="collation.unicode_ur_s3"></a>`unicode-ur-s3`
  <p>242

- <a id="collation.unicode_vi_s1"></a>`unicode-vi-s1`
  <p>243

- <a id="collation.unicode_vi_s2"></a>`unicode-vi-s2`
  <p>244

- <a id="collation.unicode_vi_s3"></a>`unicode-vi-s3`
  <p>245

- <a id="collation.unicode_vo_s1"></a>`unicode-vo-s1`
  <p>246

- <a id="collation.unicode_vo_s2"></a>`unicode-vo-s2`
  <p>247

- <a id="collation.unicode_vo_s3"></a>`unicode-vo-s3`
  <p>248

- <a id="collation.unicode_wae_s1"></a>`unicode-wae-s1`
  <p>249

- <a id="collation.unicode_wae_s2"></a>`unicode-wae-s2`
  <p>250

- <a id="collation.unicode_wae_s3"></a>`unicode-wae-s3`
  <p>251

- <a id="collation.unicode_wo_s1"></a>`unicode-wo-s1`
  <p>252

- <a id="collation.unicode_wo_s2"></a>`unicode-wo-s2`
  <p>253

- <a id="collation.unicode_wo_s3"></a>`unicode-wo-s3`
  <p>254

- <a id="collation.unicode_yo_s1"></a>`unicode-yo-s1`
  <p>255

- <a id="collation.unicode_yo_s2"></a>`unicode-yo-s2`
  <p>256

- <a id="collation.unicode_yo_s3"></a>`unicode-yo-s3`
  <p>257

- <a id="collation.unicode_zh_s1"></a>`unicode-zh-s1`
  <p>258

- <a id="collation.unicode_zh_s2"></a>`unicode-zh-s2`
  <p>259

- <a id="collation.unicode_zh_s3"></a>`unicode-zh-s3`
  <p>260

- <a id="collation.unicode_zh_big5han_s1"></a>`unicode-zh-big5han-s1`
  <p>261

- <a id="collation.unicode_zh_big5han_s2"></a>`unicode-zh-big5han-s2`
  <p>262 (zh__big5han)

- <a id="collation.unicode_zh_big5han_s3"></a>`unicode-zh-big5han-s3`
  <p>263

- <a id="collation.unicode_zh_gb2312han_s1"></a>`unicode-zh-gb2312han-s1`
  <p>264

- <a id="collation.unicode_zh_gb2312han_s2"></a>`unicode-zh-gb2312han-s2`
  <p>265 (zh__gb2312han)

- <a id="collation.unicode_zh_gb2312han_s3"></a>`unicode-zh-gb2312han-s3`
  <p>266

- <a id="collation.unicode_zh_pinyin_s1"></a>`unicode-zh-pinyin-s1`
  <p>267

- <a id="collation.unicode_zh_pinyin_s2"></a>`unicode-zh-pinyin-s2`
  <p>268 (zh__pinyin)

- <a id="collation.unicode_zh_pinyin_s3"></a>`unicode-zh-pinyin-s3`
  <p>269

- <a id="collation.unicode_zh_stroke_s1"></a>`unicode-zh-stroke-s1`
  <p>270

- <a id="collation.unicode_zh_stroke_s2"></a>`unicode-zh-stroke-s2`
  <p>271 (zh__stroke)

- <a id="collation.unicode_zh_stroke_s3"></a>`unicode-zh-stroke-s3`
  <p>272

- <a id="collation.unicode_zh_zhuyin_s1"></a>`unicode-zh-zhuyin-s1`
  <p>273

- <a id="collation.unicode_zh_zhuyin_s2"></a>`unicode-zh-zhuyin-s2`
  <p>274 (zh__zhuyin)

- <a id="collation.unicode_zh_zhuyin_s3"></a>`unicode-zh-zhuyin-s3`
  <p>275


#### <a id="field_type"></a>`enum field-type`

Field types supported by key definitions.

##### Enum Cases

- <a id="field_type.boolean"></a>`boolean`
- <a id="field_type.integer"></a>`integer`
- <a id="field_type.unsigned"></a>`unsigned`
- <a id="field_type.double"></a>`double`
- <a id="field_type.number"></a>`number`
- <a id="field_type.decimal"></a>`decimal`
- <a id="field_type.string"></a>`string`
- <a id="field_type.varbinary"></a>`varbinary`
- <a id="field_type.uuid"></a>`uuid`
- <a id="field_type.datetime"></a>`datetime`
- <a id="field_type.array"></a>`array`
- <a id="field_type.map"></a>`map`
- <a id="field_type.scalar"></a>`scalar`

#### <a id="key_part"></a>`record key-part`

Definition of a single key part in a Tarantool index.

##### Record Fields

- <a id="key_part.field_no"></a>`field-no`: `u32`
  <p>Field index in the tuple (0-based).

- <a id="key_part.field_type"></a>`field-type`: [`field-type`](#field_type)
  <p>Type required for the selected field.

- <a id="key_part.collation"></a>`collation`: option<[`collation`](#collation)>
  <p>Optional collation name for string comparison.

- <a id="key_part.path"></a>`path`: option<`string`>
  <p>JSON path for multikey indexes (if applicable). If set, `field-type`
  refers to the nested field type.

- <a id="key_part.flags"></a>`flags`: [`key-part-flags`](#key_part_flags)
  <p>Nullable/exclude-null flags for this key part.


#### <a id="box_tuple"></a>`record box-tuple`

Opaque host-issued handle to a Tarantool tuple.

The handle is meaningful only in the component instance that created it.
Consumers must not construct or modify handle values. Each returned
handle owns one reference unless documented otherwise and must be
released with the public `release` function from the
`tarantool:tarantool/box-tuple` interface. This is an interface function,
not a method on this record.

##### Record Fields

- <a id="box_tuple.handle"></a>`handle`: `u64`
  <p>Opaque value resolved by the host.


#### <a id="key_def"></a>`record key-def`

Opaque host-issued handle to a Tarantool key definition.

The handle is meaningful only in the component instance that created it.
Consumers must not construct or modify handle values. Each returned
handle is owned and must be released with the public `release` function
from the `tarantool:tarantool/key-def` interface. This is an interface
function, not a method on this record.

##### Record Fields

- <a id="key_def.handle"></a>`handle`: `u64`
  <p>Opaque value resolved by the host.


#### <a id="tuple_format"></a>`record tuple-format`

Opaque host-issued handle to a Tarantool tuple format.

Each `box-tuple` has an associated `tuple-format`. The default format
(see `tarantool:tarantool/tuple-format::default`) is used for tuples not
attached to any space.

The handle is meaningful only in the component instance that created it.
Consumers must not construct or modify handle values. Each returned
handle owns one reference unless documented otherwise and must be
released with the public `release` function from the
`tarantool:tarantool/tuple-format` interface. This is an interface
function, not a method on this record.

##### Record Fields

- <a id="tuple_format.handle"></a>`handle`: `u64`
  <p>Opaque value resolved by the host.


#### <a id="tuple_field"></a>`type tuple-field`
[`msgpack-value`](#msgpack_value)
<p>A copied tuple field encoded as one complete MessagePack value.

## <a id="tarantool_tarantool_metrics_0_2_0"></a>Import interface tarantool:tarantool/metrics@0.2.0



----

### Functions

#### <a id="uptime"></a>`uptime: func`

Returns the current uptime of the instance in seconds.

Corresponds to `box.info.uptime`.

### Returns
- Uptime in seconds as a floating-point value (`f64`).

##### Return values

- <a id="uptime.0"></a> `f64`

## <a id="tarantool_tarantool_msgpack_0_2_0"></a>Import interface tarantool:tarantool/msgpack@0.2.0



----

### Types

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>

----

### Functions

#### <a id="from_json"></a>`from-json: func`

Converts a JSON value to MessagePack.

The input must contain one JSON value. The output contains the equivalent
value encoded as one complete MessagePack value.

### Parameters
- `json`: A string containing one valid JSON value.

### Returns
- The corresponding MessagePack value.

### Errors
- A `box-error` if `json` is malformed or cannot be represented.

##### Params

- <a id="from_json.json"></a>`json`: `string`

##### Return values

- <a id="from_json.0"></a> result<[`msgpack-value`](#msgpack_value), [`box-error`](#box_error)>

#### <a id="to_json"></a>`to-json: func`

Converts a MessagePack value to JSON.

Only values representable by the JSON data model are accepted. MessagePack
extension values, binary values, and maps with non-string keys may fail.
The returned JSON is not a canonical serialization.

### Parameters
- `value`: One complete MessagePack value.

### Returns
- A string containing the equivalent JSON value.

### Errors
- A `box-error` if `value` is malformed or has no JSON representation.

##### Params

- <a id="to_json.value"></a>`value`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="to_json.0"></a> result<`string`, [`box-error`](#box_error)>

## <a id="tarantool_tarantool_database_0_2_0"></a>Import interface tarantool:tarantool/database@0.2.0



----

### Types

#### <a id="space"></a>`type space`
[`space`](#space)
<p>

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="index"></a>`type index`
[`index`](#index)
<p>

#### <a id="box_tuple"></a>`type box-tuple`
[`box-tuple`](#box_tuple)
<p>

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>

----

### Functions

#### <a id="schema_version"></a>`schema-version: func`

Returns the current schema version of the database.

The version changes when Tarantool modifies schema objects such as
spaces or indexes.

### Returns
- The current unsigned schema version.

##### Return values

- <a id="schema_version.0"></a> `u32`

#### <a id="space_by_name"></a>`space-by-name: func`

Retrieves a space object by its name.

The returned record contains a catalog ID and does not own host state.

### Parameters
- `name`: The name of the space to retrieve.

### Returns
- `some` with the space, or `none` if no space has this name.

##### Params

- <a id="space_by_name.name"></a>`name`: `string`

##### Return values

- <a id="space_by_name.0"></a> result<option<[`space`](#space)>, [`box-error`](#box_error)>

#### <a id="index_by_name"></a>`index-by-name: func`

Retrieves an index object by name within a space.

The returned record contains catalog IDs and does not own host state.

### Parameters
- `space`: The space to search within.
- `name`: The name of the index to retrieve.

### Returns
- `some` with the index, or `none` if the space has no index with this
name.

##### Params

- <a id="index_by_name.space"></a>`space`: [`space`](#space)
- <a id="index_by_name.name"></a>`name`: `string`

##### Return values

- <a id="index_by_name.0"></a> result<option<[`index`](#index)>, [`box-error`](#box_error)>

#### <a id="insert"></a>`insert: func`

Inserts a new tuple into a space.

The tuple must be one complete MessagePack array:
`[field1, field2, ...]`.

### Parameters
- `space`: The target space.
- `tup`: One complete MessagePack array containing the tuple fields.

### Returns
- An owned handle to the inserted tuple. The caller must eventually
release it with the public `release` function from the
`tarantool:tarantool/box-tuple` interface.

##### Params

- <a id="insert.space"></a>`space`: [`space`](#space)
- <a id="insert.tup"></a>`tup`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="insert.0"></a> result<[`box-tuple`](#box_tuple), [`box-error`](#box_error)>

#### <a id="update"></a>`update: func`

Updates an existing tuple by key in the specified index.

- `key` must be a MessagePack array identifying the tuple, for example
`[1]`.
- `ops` must be a MessagePack array of operations, for example
`[["=", 2, 30]]`.

### Parameters
- `index`: The index to use for locating the tuple.
- `key`: One complete MessagePack array containing exactly one item per
index part.
- `ops`: One complete MessagePack array whose items are update-operation
arrays.

### Returns
- `some` with an owned handle to the updated tuple, or `none` if no tuple
matches the key. The caller must release a returned handle with the
public `release` function from the `tarantool:tarantool/box-tuple`
interface.

##### Params

- <a id="update.index"></a>`index`: [`index`](#index)
- <a id="update.key"></a>`key`: [`msgpack-value`](#msgpack_value)
- <a id="update.ops"></a>`ops`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="update.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

#### <a id="replace"></a>`replace: func`

Replaces an existing tuple or inserts a new one.

### Parameters
- `space`: The space to operate on.
- `tup`: One complete MessagePack array containing the new tuple fields.

### Returns
- An owned handle to the replaced tuple. The caller must eventually
release it with the public `release` function from the
`tarantool:tarantool/box-tuple` interface.

##### Params

- <a id="replace.space"></a>`space`: [`space`](#space)
- <a id="replace.tup"></a>`tup`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="replace.0"></a> result<[`box-tuple`](#box_tuple), [`box-error`](#box_error)>

#### <a id="upsert"></a>`upsert: func`

Performs an UPSERT operation: update if exists, insert otherwise.

### Parameters
- `index`: The index used for key lookup.
- `tup`: One complete MessagePack tuple array to insert.
- `ops`: One complete MessagePack array whose items are update-operation
arrays.

### Returns
- `ok(())` after Tarantool applies the upsert.

### Errors
- A `box-error` if the tuple, key, or operations are invalid, or if the
operation otherwise fails.

##### Params

- <a id="upsert.index"></a>`index`: [`index`](#index)
- <a id="upsert.tup"></a>`tup`: [`msgpack-value`](#msgpack_value)
- <a id="upsert.ops"></a>`ops`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="upsert.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="delete"></a>`delete: func`

Deletes a tuple by key from the specified index.

The key must be encoded as a MessagePack array, for example `[1]`.

### Parameters
- `index`: The index used for key lookup.
- `key`: One complete MessagePack array containing exactly one item per
index part.

### Returns
- `some` with an owned handle to the deleted tuple, or `none` if no tuple
matches the key. The caller must release a returned handle with the
public `release` function from the `tarantool:tarantool/box-tuple`
interface.

##### Params

- <a id="delete.index"></a>`index`: [`index`](#index)
- <a id="delete.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="delete.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

#### <a id="truncate"></a>`truncate: func`

Removes all tuples from the space.

This operation is equivalent to SQL's `TRUNCATE TABLE`.

### Parameters
- `space`: The target space to truncate.

### Returns
- `ok(())` after the space is empty.

##### Params

- <a id="truncate.space"></a>`space`: [`space`](#space)

##### Return values

- <a id="truncate.0"></a> result<_, [`box-error`](#box_error)>

## <a id="tarantool_tarantool_log_0_2_0"></a>Import interface tarantool:tarantool/log@0.2.0



----

### Types

#### <a id="log_level"></a>`type log-level`
[`log-level`](#log_level)
<p>

#### <a id="log_context"></a>`type log-context`
[`log-context`](#log_context)
<p>

----

### Functions

#### <a id="write"></a>`write: func`

Writes a message to the Tarantool log.

The interface exposes non-terminating log levels only. Formatting and
level-specific convenience helpers belong in guest libraries.

### Parameters
- `level`: Message severity.
- `message`: Message text.
- `context`: Optional guest source location.

##### Params

- <a id="write.level"></a>`level`: [`log-level`](#log_level)
- <a id="write.message"></a>`message`: `string`
- <a id="write.context"></a>`context`: option<[`log-context`](#log_context)>

## <a id="tarantool_tarantool_error_0_2_0"></a>Import interface tarantool:tarantool/error@0.2.0



----

### Types

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="error_code"></a>`type error-code`
[`error-code`](#error_code)
<p>

----

### Functions

#### <a id="new"></a>`new: func`

Creates a copied error value.

Corresponds to `box.error.new{ ... }`.

### Parameters
- `code`: Raw numeric Tarantool error code. Codes unknown to this WIT
package are accepted without remapping.
- `message`: The error message.

### Returns
- A new `box-error` value.

##### Params

- <a id="new.code"></a>`code`: [`error-code`](#error_code)
- <a id="new.message"></a>`message`: `string`

##### Return values

- <a id="new.0"></a> [`box-error`](#box_error)

#### <a id="new_with_location"></a>`new-with-location: func`

Creates a copied error value with a source location.

Corresponds to `box.error.new{ ... }`.

### Parameters
- `code`: Raw numeric Tarantool error code. Codes unknown to this WIT
package are accepted without remapping.
- `message`: The error message.
- `file`: File name.
- `line`: Line number in file.

### Returns
- A new `box-error` value.

##### Params

- <a id="new_with_location.code"></a>`code`: [`error-code`](#error_code)
- <a id="new_with_location.message"></a>`message`: `string`
- <a id="new_with_location.file"></a>`file`: option<`string`>
- <a id="new_with_location.line"></a>`line`: option<`u32`>

##### Return values

- <a id="new_with_location.0"></a> [`box-error`](#box_error)

#### <a id="set"></a>`set: func`

Sets the given error as the current "last error".

Corresponds to `box.error.set(err)`.

### Parameters
- `err`: The error to set.

##### Params

- <a id="set.err"></a>`err`: [`box-error`](#box_error)

#### <a id="last"></a>`last: func`

Returns a copy of the last error in the current execution context.

Corresponds to `box.error.last()`.
Returns `none` if no error is currently set.

##### Return values

- <a id="last.0"></a> option<[`box-error`](#box_error)>

#### <a id="clear"></a>`clear: func`

Clears the last error.

Corresponds to `box.error.clear()`.

#### <a id="to_string"></a>`to-string: func`

Formats a `box-error` value for diagnostics.

Equivalent to `tostring(err)` in Tarantool.

### Parameters
- `err`: The error to stringify.

### Returns
- A human-readable string describing the error.

##### Params

- <a id="to_string.err"></a>`err`: [`box-error`](#box_error)

##### Return values

- <a id="to_string.0"></a> `string`

## <a id="tarantool_tarantool_session_0_2_0"></a>Import interface tarantool:tarantool/session@0.2.0



----

### Types

#### <a id="session"></a>`type session`
[`session`](#session)
<p>

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>

----

### Functions

#### <a id="current"></a>`current: func`

Returns the current session.

The record identifies the connection or execution context from which
the current code runs. It does not own the session.

### Returns
- A `session` object representing the current session.

##### Return values

- <a id="current.0"></a> [`session`](#session)

#### <a id="broadcast"></a>`broadcast: func`

Broadcasts a message to all watchers subscribed to the given key.

`value` is a Lua expression whose evaluated value is passed to
`box.broadcast`. It is not JSON. Invalid expressions return an error;
callers must not interpolate untrusted text into the expression.

### Parameters
- `key`: A string event name to broadcast on.
- `value`: A Lua expression, for example `"{a = 1}"`.

### Returns
- `ok` on success, or a `box-error` on failure.

### Errors
- A `box-error` if the key or Lua expression is invalid or broadcast
fails.

##### Params

- <a id="broadcast.key"></a>`key`: `string`
- <a id="broadcast.value"></a>`value`: `string`

##### Return values

- <a id="broadcast.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="iproto_send"></a>`iproto-send: func`

Sends a raw IPROTO packet to a specific session.

The header must be one complete MessagePack map. The optional body, when
present, must also be one complete MessagePack map.

### Parameters
- `session`: Target session to send to.
- `header`: MessagePack map containing the request header.
- `body`: `some` with a MessagePack map, or `none` to omit the body.

### Returns
- `ok(())` after the packet is accepted for sending.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="iproto_send.session"></a>`session`: [`session`](#session)
- <a id="iproto_send.header"></a>`header`: [`msgpack-value`](#msgpack_value)
- <a id="iproto_send.body"></a>`body`: option<[`msgpack-value`](#msgpack_value)>

##### Return values

- <a id="iproto_send.0"></a> result<_, [`box-error`](#box_error)>

## <a id="tarantool_tarantool_transaction_0_2_0"></a>Import interface tarantool:tarantool/transaction@0.2.0



----

### Types

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="transaction_isolation"></a>`type transaction-isolation`
[`transaction-isolation`](#transaction_isolation)
<p>

----

### Functions

#### <a id="id"></a>`id: func`

Returns the current transaction ID.

A transaction ID is a non-persistent identifier of the current
transaction. Returns `none` if no transaction is active.

### Returns
- `some` with the unsigned transaction ID, or `none`.

##### Return values

- <a id="id.0"></a> option<`u64`>

#### <a id="isolation"></a>`isolation: func`

Returns the isolation level of the current transaction.

Returns `none` if there is no active transaction.

### Returns
- `some` with the current isolation level, or `none`.

##### Return values

- <a id="isolation.0"></a> option<[`transaction-isolation`](#transaction_isolation)>

#### <a id="begin"></a>`begin: func`

Begins a new transaction.

Fails if the current execution context already has an active
transaction.

### Errors
- A `box-error` describing the failure.

##### Return values

- <a id="begin.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="commit"></a>`commit: func`

Commits the current transaction.

Finalizes the transaction and applies its changes.

### Errors
- A `box-error` describing the failure.

##### Return values

- <a id="commit.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="rollback"></a>`rollback: func`

Rolls back the current transaction.

Discards all changes made within the current transaction.

### Errors
- A `box-error` describing the failure.

##### Return values

- <a id="rollback.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="set_isolation"></a>`set-isolation: func`

Sets the isolation level for the current transaction.

Call this before the first DML operation in the transaction.

### Parameters
- `isolation`: A `transaction-isolation` value.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="set_isolation.isolation"></a>`isolation`: [`transaction-isolation`](#transaction_isolation)

##### Return values

- <a id="set_isolation.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="make_synchronous"></a>`make-synchronous: func`

Requires synchronous replication for the current transaction.

Commit waits for the configured synchronous replication acknowledgements.
This function has no effect when no transaction is active.

## <a id="tarantool_tarantool_index_0_2_0"></a>Import interface tarantool:tarantool/index@0.2.0



----

### Types

#### <a id="index"></a>`type index`
[`index`](#index)
<p>

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="box_tuple"></a>`type box-tuple`
[`box-tuple`](#box_tuple)
<p>

#### <a id="iterator_type"></a>`type iterator-type`
[`iterator-type`](#iterator_type)
<p>

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>

#### <a id="iterator"></a>`resource iterator`

Index iterator resource for scanning tuples.
----

### Functions

#### <a id="tuple_count"></a>`tuple-count: func`

Returns the number of tuples stored in the index.

### Parameters
- `index`: The index to query.

### Returns
- The number of tuples in the index, or a `box-error` on failure.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="tuple_count.index"></a>`index`: [`index`](#index)

##### Return values

- <a id="tuple_count.0"></a> result<`u64`, [`box-error`](#box_error)>

#### <a id="memory_size"></a>`memory-size: func`

Returns the memory size of the index in bytes.

### Parameters
- `index`: The index to inspect.

### Returns
- Size in bytes, or a `box-error`.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="memory_size.index"></a>`index`: [`index`](#index)

##### Return values

- <a id="memory_size.0"></a> result<`u64`, [`box-error`](#box_error)>

#### <a id="random"></a>`random: func`

Returns a random tuple from the index.

### Parameters
- `index`: The index to read from.
- `rnd`: A random seed value.

### Returns
- `some` with an owned tuple handle, or `none` if the index is empty.
The caller must release a returned handle with the public `release`
function from the `tarantool:tarantool/box-tuple` interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="random.index"></a>`index`: [`index`](#index)
- <a id="random.rnd"></a>`rnd`: `u32`

##### Return values

- <a id="random.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

#### <a id="get"></a>`get: func`

Gets a tuple by key from the index.

The key must be one complete MessagePack array, for example `[1]`.

### Parameters
- `index`: The index to search.
- `key`: MessagePack array containing exactly one item per index part.

### Returns
- `some` with an owned tuple handle, or `none` if no tuple matches.
The caller must release a returned handle with the public `release`
function from the `tarantool:tarantool/box-tuple` interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="get.index"></a>`index`: [`index`](#index)
- <a id="get.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="get.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

#### <a id="min"></a>`min: func`

Finds the minimal tuple matching the given key.

### Parameters
- `index`: The index to search.
- `key`: MessagePack array containing zero or more key parts.

### Returns
- `some` with an owned tuple handle, or `none` if no tuple matches.
The caller must release a returned handle with the public `release`
function from the `tarantool:tarantool/box-tuple` interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="min.index"></a>`index`: [`index`](#index)
- <a id="min.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="min.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

#### <a id="max"></a>`max: func`

Finds the maximal tuple matching the given key.

### Parameters
- `index`: The index to search.
- `key`: MessagePack array containing zero or more key parts.

### Returns
- `some` with an owned tuple handle, or `none` if no tuple matches.
The caller must release a returned handle with the public `release`
function from the `tarantool:tarantool/box-tuple` interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="max.index"></a>`index`: [`index`](#index)
- <a id="max.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="max.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

#### <a id="count"></a>`count: func`

Counts tuples matching a key and iterator mode.

### Parameters
- `index`: Index to query.
- `mode`: Iterator mode used to match tuples.
- `key`: MessagePack array containing zero or more key parts.

### Returns
- Count of matching tuples, or an error.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="count.index"></a>`index`: [`index`](#index)
- <a id="count.mode"></a>`mode`: [`iterator-type`](#iterator_type)
- <a id="count.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="count.0"></a> result<`u64`, [`box-error`](#box_error)>

#### <a id="static_iterator_new"></a>`[static]iterator.new: func`

Allocates an iterator for the given index.

- `index`: The index to scan.
- `mode`: Scan mode (see `tarantool:tarantool/types::iterator-type`).
- `key`: MessagePack array containing zero or more key parts.

Dropping the returned resource releases its host iterator state.

##### Params

- <a id="static_iterator_new.index"></a>`index`: [`index`](#index)
- <a id="static_iterator_new.mode"></a>`mode`: [`iterator-type`](#iterator_type)
- <a id="static_iterator_new.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="static_iterator_new.0"></a> result<own<[`iterator`](#iterator)>, [`box-error`](#box_error)>

#### <a id="method_iterator_next"></a>`[method]iterator.next: func`

Advance the iterator and return the next tuple.

Returns `some` with an owned tuple handle, or `none` when the
iterator is exhausted. The caller must release a returned handle
with the public `release` function from the
`tarantool:tarantool/box-tuple` interface.

##### Params

- <a id="method_iterator_next.self"></a>`self`: borrow<[`iterator`](#iterator)>

##### Return values

- <a id="method_iterator_next.0"></a> result<option<[`box-tuple`](#box_tuple)>, [`box-error`](#box_error)>

## <a id="tarantool_tarantool_sequence_0_2_0"></a>Import interface tarantool:tarantool/sequence@0.2.0



----

### Types

#### <a id="sequence"></a>`type sequence`
[`sequence`](#sequence)
<p>

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

----

### Functions

#### <a id="next"></a>`next: func`

Generates the next value of the specified sequence.

This updates the state of the sequence.

### Parameters
- `seq`: The target sequence object.

### Returns
- The next value of the sequence as `s64`.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="next.seq"></a>`seq`: [`sequence`](#sequence)

##### Return values

- <a id="next.0"></a> result<`s64`, [`box-error`](#box_error)>

#### <a id="current"></a>`current: func`

Returns the current value of the specified sequence.

Unlike `next`, this does not increment the sequence. It returns an error
if the sequence has not been advanced or set since creation or reset.

### Parameters
- `seq`: The target sequence object.

### Returns
- The current value of the sequence as `s64`.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="current.seq"></a>`seq`: [`sequence`](#sequence)

##### Return values

- <a id="current.0"></a> result<`s64`, [`box-error`](#box_error)>

#### <a id="set"></a>`set: func`

Sets the sequence to a specific value.

### Parameters
- `seq`: The target sequence object.
- `value`: The new value to assign.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="set.seq"></a>`seq`: [`sequence`](#sequence)
- <a id="set.value"></a>`value`: `s64`

##### Return values

- <a id="set.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="reset"></a>`reset: func`

Resets the sequence to its initial state.

This clears the current value. After a reset, `current` returns an error
until `next` or `set` assigns another value.

### Parameters
- `seq`: The target sequence object.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="reset.seq"></a>`seq`: [`sequence`](#sequence)

##### Return values

- <a id="reset.0"></a> result<_, [`box-error`](#box_error)>

## <a id="tarantool_tarantool_key_def_0_2_0"></a>Import interface tarantool:tarantool/key-def@0.2.0



----

### Types

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="box_tuple"></a>`type box-tuple`
[`box-tuple`](#box_tuple)
<p>

#### <a id="key_def"></a>`type key-def`
[`key-def`](#key_def)
<p>

#### <a id="key_part"></a>`type key-part`
[`key-part`](#key_part)
<p>

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>

----

### Functions

#### <a id="new"></a>`new: func`

Creates a new key definition from a list of parts.

Each key part selects a tuple field and defines its type, optional
collation, optional path, and flags.

### Parameters
- `parts`: List of `key-part` objects.

### Returns
- A new owned `key-def` handle on success. The caller must eventually
release it with the public `release` function in this interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="new.parts"></a>`parts`: list<[`key-part`](#key_part)>

##### Return values

- <a id="new.0"></a> result<[`key-def`](#key_def), [`box-error`](#box_error)>

#### <a id="duplicate"></a>`duplicate: func`

Creates a deep copy of the given key definition.

The returned `key-def` is independent of the original and owns one
reference.

### Parameters
- `key-def`: The key definition to duplicate.

### Returns
- A new owned `key-def` handle independent of the original. The caller
must eventually release it with the public `release` function in this
interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="duplicate.key_def"></a>`key-def`: [`key-def`](#key_def)

##### Return values

- <a id="duplicate.0"></a> result<[`key-def`](#key_def), [`box-error`](#box_error)>

#### <a id="merge"></a>`merge: func`

Merges two key definitions into one.

Fields from the right-hand side are appended when they do not duplicate
fields from the left-hand side.

### Parameters
- `left`: The base key definition.
- `right`: The key definition to append fields from.

### Returns
- A new owned `key-def` handle. The caller must eventually release it
with the public `release` function in this interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="merge.left"></a>`left`: [`key-def`](#key_def)
- <a id="merge.right"></a>`right`: [`key-def`](#key_def)

##### Return values

- <a id="merge.0"></a> result<[`key-def`](#key_def), [`box-error`](#box_error)>

#### <a id="release"></a>`release: func`

Releases a key definition and invalidates all aliases of its handle.

Call this once for every key definition returned by `new`,
`duplicate`, or `merge`. Releasing a stale handle traps.

### Parameters
- `key-def`: The key definition to release.

##### Params

- <a id="release.key_def"></a>`key-def`: [`key-def`](#key_def)

#### <a id="dump_parts"></a>`dump-parts: func`

Returns a list of key parts from a given key definition.

The returned list is copied into guest-owned memory.

### Parameters
- `key-def`: The key definition to inspect.

### Returns
- List of `key-part` objects.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="dump_parts.key_def"></a>`key-def`: [`key-def`](#key_def)

##### Return values

- <a id="dump_parts.0"></a> result<list<[`key-part`](#key_part)>, [`box-error`](#box_error)>

#### <a id="validate_key"></a>`validate-key: func`

Validates whether a given key conforms to the key definition.

Checks the number of fields and their types, allowing partial matches
(e.g. prefix of the full key).

### Parameters
- `key-def`: Key definition to validate against.
- `key`: One complete MessagePack array of key parts.

### Returns
- `ok` if the key conforms to the definition.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="validate_key.key_def"></a>`key-def`: [`key-def`](#key_def)
- <a id="validate_key.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="validate_key.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="validate_full_key"></a>`validate-full-key: func`

Validates whether a key **fully** matches the key definition.

Differs from `validate-key` by requiring exact number of parts.

### Parameters
- `key-def`: Key definition to validate against.
- `key`: One complete MessagePack array with exactly one item per key
part.

### Returns
- `ok` if the key fully conforms to the definition.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="validate_full_key.key_def"></a>`key-def`: [`key-def`](#key_def)
- <a id="validate_full_key.key"></a>`key`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="validate_full_key.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="part_count"></a>`part-count: func`

Returns the number of parts in the key definition.

Each part corresponds to one field used in index comparison or validation.

### Parameters
- `key-def`: The key definition.

### Returns
- Number of parts as `u32`.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="part_count.key_def"></a>`key-def`: [`key-def`](#key_def)

##### Return values

- <a id="part_count.0"></a> result<`u32`, [`box-error`](#box_error)>

#### <a id="extract_key"></a>`extract-key: func`

Extracts a key from a given tuple based on the key definition.

The result is a MessagePack-encoded byte buffer representing the key,
constructed by selecting fields from the input tuple as defined
by the provided key definition.

This buffer can be decoded using a MessagePack decoder and will contain
an array of fields corresponding to the key parts.

### Parameters
- `key-def`: Key definition describing how to extract fields.
- `tuple`: Source `box-tuple`.

### Returns
- One complete MessagePack array containing the extracted key fields.

### Errors
- Returns a `box-error` if the tuple is invalid or extraction fails.

##### Params

- <a id="extract_key.key_def"></a>`key-def`: [`key-def`](#key_def)
- <a id="extract_key.tuple"></a>`tuple`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="extract_key.0"></a> result<[`msgpack-value`](#msgpack_value), [`box-error`](#box_error)>

#### <a id="validate_tuple"></a>`validate-tuple: func`

Validates whether the tuple contains all required fields
and types as specified by the key definition.

This is useful to check if a `box-tuple` is compatible with an index.

### Parameters
- `key-def`: Key definition to validate against.
- `tuple`: A `box-tuple` to validate.

### Returns
- `ok` if the tuple satisfies the key definition.

A tuple that does not satisfy the definition is returned as a
`box-error`; it is not a normal boolean result.

##### Params

- <a id="validate_tuple.key_def"></a>`key-def`: [`key-def`](#key_def)
- <a id="validate_tuple.tuple"></a>`tuple`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="validate_tuple.0"></a> result<_, [`box-error`](#box_error)>

## <a id="tarantool_tarantool_tuple_format_0_2_0"></a>Import interface tarantool:tarantool/tuple-format@0.2.0



----

### Types

#### <a id="key_def"></a>`type key-def`
[`key-def`](#key_def)
<p>

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="tuple_format"></a>`type tuple-format`
[`tuple-format`](#tuple_format)
<p>

----

### Functions

#### <a id="default"></a>`default: func`

Returns the default tuple format.

This format is used to create tuples not bound to any specific space.

### Returns
- An owned `tuple-format` handle. The caller must eventually release it
with the public `release` function in this interface.

##### Return values

- <a id="default.0"></a> [`tuple-format`](#tuple_format)

#### <a id="new"></a>`new: func`

Creates a new tuple format based on a list of key definitions.

Key definitions supply field types, paths, collations, and nullability
constraints.

### Parameters
- `key-defs`: Borrowed key-definition handles used only for this call.
The returned format remains valid after the inputs are released.

### Returns
- A new owned `tuple-format` handle. The caller must eventually release
it with the public `release` function in this interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="new.key_defs"></a>`key-defs`: list<[`key-def`](#key_def)>

##### Return values

- <a id="new.0"></a> result<[`tuple-format`](#tuple_format), [`box-error`](#box_error)>

#### <a id="retain"></a>`retain: func`

Increments the reference counter of the tuple format.

Call this to acquire one additional ownership reference for the same
handle. Copying the handle alone does not acquire a reference.

### Parameters
- `tf`: Tuple format to retain.

##### Params

- <a id="retain.tf"></a>`tf`: [`tuple-format`](#tuple_format)

#### <a id="release"></a>`release: func`

Decrements the reference counter of the tuple format.

Must be called once for every owned reference. The final `release`
invalidates all aliases of the handle. Releasing a stale handle traps.

### Parameters
- `tf`: Tuple format to release.

##### Params

- <a id="release.tf"></a>`tf`: [`tuple-format`](#tuple_format)

## <a id="tarantool_tarantool_box_tuple_0_2_0"></a>Import interface tarantool:tarantool/box-tuple@0.2.0



----

### Types

#### <a id="box_error"></a>`type box-error`
[`box-error`](#box_error)
<p>

#### <a id="box_tuple"></a>`type box-tuple`
[`box-tuple`](#box_tuple)
<p>

#### <a id="tuple_field"></a>`type tuple-field`
[`tuple-field`](#tuple_field)
<p>

#### <a id="tuple_format"></a>`type tuple-format`
[`tuple-format`](#tuple_format)
<p>

#### <a id="key_def"></a>`type key-def`
[`key-def`](#key_def)
<p>

#### <a id="msgpack_value"></a>`type msgpack-value`
[`msgpack-value`](#msgpack_value)
<p>

#### <a id="iterator"></a>`resource iterator`

Stateful traversal over the top-level fields of one tuple.
----

### Functions

#### <a id="new"></a>`new: func`

Creates a new tuple from MessagePack data using the default tuple format.

The data must be a MessagePack-encoded array (for example,
`[1, "abc", {"x": 42}]`).

### Parameters
- `data`: One complete MessagePack array containing the tuple fields.

### Returns
- A new owned `box-tuple` handle, or `box-error`. The caller must
eventually release it with the public `release` function in this
interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="new.data"></a>`data`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="new.0"></a> result<[`box-tuple`](#box_tuple), [`box-error`](#box_error)>

#### <a id="retain"></a>`retain: func`

Increases the reference count of the tuple.

Call this to acquire one additional ownership reference for the same
handle. Copying the handle alone does not acquire a reference.

### Parameters
- `t`: The tuple to retain.

##### Params

- <a id="retain.t"></a>`t`: [`box-tuple`](#box_tuple)

#### <a id="release"></a>`release: func`

Decreases the reference count of the tuple.

If the count reaches zero, the handle and all of its aliases become
stale. Releasing a stale handle traps.

### Parameters
- `t`: The tuple to release.

##### Params

- <a id="release.t"></a>`t`: [`box-tuple`](#box_tuple)

#### <a id="field_count"></a>`field-count: func`

Returns the number of fields in the tuple (i.e., array size).

### Parameters
- `t`: The tuple.

### Returns
- Field count as `u32`.

##### Params

- <a id="field_count.t"></a>`t`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="field_count.0"></a> `u32`

#### <a id="byte_size"></a>`byte-size: func`

Returns the byte size of the internal MessagePack data.

Useful for buffer allocations.

### Parameters
- `t`: The tuple.

### Returns
- Number of bytes used as `u64`.

##### Params

- <a id="byte_size.t"></a>`t`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="byte_size.0"></a> `u64`

#### <a id="to_bytes"></a>`to-bytes: func`

Serializes the tuple to a MessagePack byte array.

This data can be passed to the public `to-json` function from the
`tarantool:tarantool/msgpack` interface or to another MessagePack
decoder.

### Parameters
- `t`: The tuple.

### Returns
- One complete MessagePack array containing the tuple fields.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="to_bytes.t"></a>`t`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="to_bytes.0"></a> result<[`msgpack-value`](#msgpack_value), [`box-error`](#box_error)>

#### <a id="format"></a>`format: func`

Returns the format object associated with the tuple.

### Parameters
- `t`: The tuple.

### Returns
- An owned handle to the `tuple-format` used to construct the tuple.
The caller must eventually release it with the public `release`
function from the `tarantool:tarantool/tuple-format` interface.

##### Params

- <a id="format.t"></a>`t`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="format.0"></a> [`tuple-format`](#tuple_format)

#### <a id="field"></a>`field: func`

Returns the field at the specified index (zero-based).

The returned value contains one complete copied MessagePack value.

### Parameters
- `t`: The tuple.
- `idx`: Field index (starting from 0).

### Returns
- `some` with a copied field, or `none` if `idx` is out of range.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="field.t"></a>`t`: [`box-tuple`](#box_tuple)
- <a id="field.idx"></a>`idx`: `u32`

##### Return values

- <a id="field.0"></a> result<option<[`tuple-field`](#tuple_field)>, [`box-error`](#box_error)>

#### <a id="field_by_path"></a>`field-by-path: func`

Returns a copied field selected by a JSON path expression.

### Parameters
- `t`: The tuple.
- `path`: Path expression (e.g., `"[2].x"`).
Array indexes in the path are zero-based.

### Returns
- `some` with a copied field, or `none` if the path selects no field.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="field_by_path.t"></a>`t`: [`box-tuple`](#box_tuple)
- <a id="field_by_path.path"></a>`path`: `string`

##### Return values

- <a id="field_by_path.0"></a> result<option<[`tuple-field`](#tuple_field)>, [`box-error`](#box_error)>

#### <a id="update"></a>`update: func`

Updates fields in a tuple using the given update expression.

The expression must be a MessagePack array of operation arrays, for
example `[["=", 1, "new_value"]]`. Operation field indexes are
zero-based. The original tuple is unchanged.

### Parameters
- `t`: The tuple to update.
- `expr`: One complete MessagePack array whose items are update-operation
arrays.

### Returns
- A new owned `box-tuple` handle with applied updates, or a `box-error`.
The caller must eventually release it with the public `release`
function in this interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="update.t"></a>`t`: [`box-tuple`](#box_tuple)
- <a id="update.expr"></a>`expr`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="update.0"></a> result<[`box-tuple`](#box_tuple), [`box-error`](#box_error)>

#### <a id="upsert"></a>`upsert: func`

Applies update operations while ignoring client-operation errors.

Valid operations are applied to a copy of the tuple. Invalid operations,
such as a type mismatch or missing field, are skipped and may be logged
by Tarantool. System failures still return `box-error`. Despite its
name, this function does not insert a tuple into a space. The original
tuple is unchanged.

### Parameters
- `t`: The tuple.
- `expr`: One complete MessagePack array whose items are update-operation
arrays.

### Returns
- A new owned `box-tuple` handle with the result, or a `box-error`.
The caller must eventually release it with the public `release`
function in this interface.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="upsert.t"></a>`t`: [`box-tuple`](#box_tuple)
- <a id="upsert.expr"></a>`expr`: [`msgpack-value`](#msgpack_value)

##### Return values

- <a id="upsert.0"></a> result<[`box-tuple`](#box_tuple), [`box-error`](#box_error)>

#### <a id="validate"></a>`validate: func`

Validates a tuple against the given format.

Checks field types and nullability constraints.

### Parameters
- `t`: The tuple to validate.
- `format`: Tuple format to validate against.

### Returns
- `ok` if the tuple conforms to the format.

A tuple that does not conform is returned as a `box-error`; it is not a
normal boolean result.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="validate.t"></a>`t`: [`box-tuple`](#box_tuple)
- <a id="validate.format"></a>`format`: [`tuple-format`](#tuple_format)

##### Return values

- <a id="validate.0"></a> result<_, [`box-error`](#box_error)>

#### <a id="compare"></a>`compare: func`

Compares two tuples using a given key definition.

The comparison is lexicographical by key fields.

### Parameters
- `key-def`: Definition of fields to compare.
- `left`: First tuple.
- `right`: Second tuple.

### Returns
- `0` if equal
- `<0` if `left < right`
- `>0` if `left > right`

##### Params

- <a id="compare.key_def"></a>`key-def`: [`key-def`](#key_def)
- <a id="compare.left"></a>`left`: [`box-tuple`](#box_tuple)
- <a id="compare.right"></a>`right`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="compare.0"></a> `s32`

#### <a id="compare_with_key"></a>`compare-with-key: func`

Compares a tuple with a key using the given key definition.

### Parameters
- `tuple`: Tuple to compare.
- `key`: One complete MessagePack array of key parts.
- `key-def`: Key definition.

### Returns
- `0` if key matches tuple
- `<0` if tuple < key
- `>0` if tuple > key

### Errors
- A `box-error` if `key` is malformed, does not match the key
definition, or cannot be compared.

##### Params

- <a id="compare_with_key.tuple"></a>`tuple`: [`box-tuple`](#box_tuple)
- <a id="compare_with_key.key"></a>`key`: [`msgpack-value`](#msgpack_value)
- <a id="compare_with_key.key_def"></a>`key-def`: [`key-def`](#key_def)

##### Return values

- <a id="compare_with_key.0"></a> result<`s32`, [`box-error`](#box_error)>

#### <a id="static_iterator_new"></a>`[static]iterator.new: func`

Creates a new iterator over the fields of a tuple.

This allows sequential or random access to MessagePack fields within
the tuple.

### Parameters
- `tuple`: Borrowed for this call. The returned iterator retains the
tuple independently, so the caller may release its tuple handle
after this function returns.

### Returns
- A new `iterator` resource, or a `box-error`. Dropping the
iterator releases its retained tuple reference.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="static_iterator_new.tuple"></a>`tuple`: [`box-tuple`](#box_tuple)

##### Return values

- <a id="static_iterator_new.0"></a> result<own<[`iterator`](#iterator)>, [`box-error`](#box_error)>

#### <a id="method_iterator_position"></a>`[method]iterator.position: func`

Returns the current iterator position (index of the next field).

### Returns
- The next field index (zero-based).

##### Params

- <a id="method_iterator_position.self"></a>`self`: borrow<[`iterator`](#iterator)>

##### Return values

- <a id="method_iterator_position.0"></a> `u32`

#### <a id="method_iterator_rewind"></a>`[method]iterator.rewind: func`

Rewinds the iterator to the beginning of the tuple.

After this call, the next field will be the first.

##### Params

- <a id="method_iterator_rewind.self"></a>`self`: borrow<[`iterator`](#iterator)>

#### <a id="method_iterator_seek"></a>`[method]iterator.seek: func`

Seeks to and returns a field at the given tuple index.

After a successful call, `position` points to the following field,
so the next call to `next` continues after the returned value.

### Parameters
- `pos`: Zero-based field index to seek to.

### Returns
- `some` with a copied field, or `none` if `pos` is outside the
tuple.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="method_iterator_seek.self"></a>`self`: borrow<[`iterator`](#iterator)>
- <a id="method_iterator_seek.pos"></a>`pos`: `u32`

##### Return values

- <a id="method_iterator_seek.0"></a> result<option<[`tuple-field`](#tuple_field)>, [`box-error`](#box_error)>

#### <a id="method_iterator_next"></a>`[method]iterator.next: func`

Returns the next field in the tuple.

Returns `none` if there are no more fields.

### Returns
- `some` containing a copied `tuple-field`, or `none` when the
iterator is exhausted.

### Errors
- A `box-error` describing the failure.

##### Params

- <a id="method_iterator_next.self"></a>`self`: borrow<[`iterator`](#iterator)>

##### Return values

- <a id="method_iterator_next.0"></a> result<option<[`tuple-field`](#tuple_field)>, [`box-error`](#box_error)>

