1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
use std::convert::TryFrom;
pub static MAX_PAYLOAD_LEN: usize = 16_777_215;
pub static DEFAULT_MAX_ALLOWED_PACKET: usize = 4 * 1024 * 1024;
pub static MIN_COMPRESS_LENGTH: usize = 50;
pub static UTF8_GENERAL_CI: u16 = 33;
pub static UTF8MB4_GENERAL_CI: u16 = 45;
my_bitflags! {
StatusFlags,
#[error("Unknown flags in the raw value of StatusFlags (raw={:b})", _0)]
UnknownStatusFlags,
u16,
pub struct StatusFlags: u16 {
const SERVER_STATUS_IN_TRANS = 0x0001;
const SERVER_STATUS_AUTOCOMMIT = 0x0002;
const SERVER_MORE_RESULTS_EXISTS = 0x0008;
const SERVER_STATUS_NO_GOOD_INDEX_USED = 0x0010;
const SERVER_STATUS_NO_INDEX_USED = 0x0020;
const SERVER_STATUS_CURSOR_EXISTS = 0x0040;
const SERVER_STATUS_LAST_ROW_SENT = 0x0080;
const SERVER_STATUS_DB_DROPPED = 0x0100;
const SERVER_STATUS_NO_BACKSLASH_ESCAPES = 0x0200;
const SERVER_STATUS_METADATA_CHANGED = 0x0400;
const SERVER_QUERY_WAS_SLOW = 0x0800;
const SERVER_PS_OUT_PARAMS = 0x1000;
const SERVER_STATUS_IN_TRANS_READONLY = 0x2000;
const SERVER_SESSION_STATE_CHANGED = 0x4000;
}
}
my_bitflags! {
CapabilityFlags,
#[error("Unknown flags in the raw value of CapabilityFlags (raw={:b})", _0)]
UnknownCapabilityFlags,
u32,
pub struct CapabilityFlags: u32 {
const CLIENT_LONG_PASSWORD = 0x0000_0001;
const CLIENT_FOUND_ROWS = 0x0000_0002;
const CLIENT_LONG_FLAG = 0x0000_0004;
const CLIENT_CONNECT_WITH_DB = 0x0000_0008;
const CLIENT_NO_SCHEMA = 0x0000_0010;
const CLIENT_COMPRESS = 0x0000_0020;
const CLIENT_ODBC = 0x0000_0040;
const CLIENT_LOCAL_FILES = 0x0000_0080;
const CLIENT_IGNORE_SPACE = 0x0000_0100;
const CLIENT_PROTOCOL_41 = 0x0000_0200;
const CLIENT_INTERACTIVE = 0x0000_0400;
const CLIENT_SSL = 0x0000_0800;
const CLIENT_IGNORE_SIGPIPE = 0x0000_1000;
const CLIENT_TRANSACTIONS = 0x0000_2000;
const CLIENT_RESERVED = 0x0000_4000;
const CLIENT_SECURE_CONNECTION = 0x0000_8000;
const CLIENT_MULTI_STATEMENTS = 0x0001_0000;
const CLIENT_MULTI_RESULTS = 0x0002_0000;
const CLIENT_PS_MULTI_RESULTS = 0x0004_0000;
const CLIENT_PLUGIN_AUTH = 0x0008_0000;
const CLIENT_CONNECT_ATTRS = 0x0010_0000;
const CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA = 0x0020_0000;
const CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS = 0x0040_0000;
const CLIENT_SESSION_TRACK = 0x0080_0000;
const CLIENT_DEPRECATE_EOF = 0x0100_0000;
const CLIENT_OPTIONAL_RESULTSET_METADATA = 0x0200_0000;
const CLIENT_ZSTD_COMPRESSION_ALGORITHM = 0x0400_0000;
const CLIENT_QUERY_ATTRIBUTES = 0x0800_0000;
const MULTI_FACTOR_AUTHENTICATION = 0x1000_0000;
const CLIENT_PROGRESS_OBSOLETE = 0x2000_0000;
const CLIENT_SSL_VERIFY_SERVER_CERT = 0x4000_0000;
const CLIENT_REMEMBER_OPTIONS = 0x8000_0000;
}
}
my_bitflags! {
CursorType,
#[error("Unknown flags in the raw value of CursorType (raw={:b})", _0)]
UnknownCursorType,
u8,
pub struct CursorType: u8 {
const CURSOR_TYPE_NO_CURSOR = 0_u8;
const CURSOR_TYPE_READ_ONLY = 1_u8;
const CURSOR_TYPE_FOR_UPDATE = 2_u8;
const CURSOR_TYPE_SCROLLABLE = 4_u8;
}
}
my_bitflags! {
StmtExecuteParamsFlags,
#[error("Unknown flags in the raw value of StmtExecuteParamsFlags (raw={:b})", _0)]
UnknownStmtExecuteParamsFlags,
u8,
pub struct StmtExecuteParamsFlags: u8 {
const NEW_PARAMS_BOUND = 1_u8;
}
}
my_bitflags! {
StmtExecuteParamFlags,
#[error("Unknown flags in the raw value of StmtExecuteParamFlags (raw={:b})", _0)]
UnknownStmtExecuteParamFlags,
u8,
pub struct StmtExecuteParamFlags: u8 {
const UNSIGNED = 128_u8;
}
}
my_bitflags! {
ColumnFlags,
#[error("Unknown flags in the raw value of ColumnFlags (raw={:b})", _0)]
UnknownColumnFlags,
u16,
pub struct ColumnFlags: u16 {
const NOT_NULL_FLAG = 1u16;
const PRI_KEY_FLAG = 2u16;
const UNIQUE_KEY_FLAG = 4u16;
const MULTIPLE_KEY_FLAG = 8u16;
const BLOB_FLAG = 16u16;
const UNSIGNED_FLAG = 32u16;
const ZEROFILL_FLAG = 64u16;
const BINARY_FLAG = 128u16;
const ENUM_FLAG = 256u16;
const AUTO_INCREMENT_FLAG = 512u16;
const TIMESTAMP_FLAG = 1024u16;
const SET_FLAG = 2048u16;
const NO_DEFAULT_VALUE_FLAG = 4096u16;
const ON_UPDATE_NOW_FLAG = 8192u16;
const PART_KEY_FLAG = 16384u16;
const NUM_FLAG = 32768u16;
}
}
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
#[repr(u8)]
pub enum Command {
COM_SLEEP = 0,
COM_QUIT,
COM_INIT_DB,
COM_QUERY,
COM_FIELD_LIST,
COM_CREATE_DB,
COM_DROP_DB,
COM_REFRESH,
COM_DEPRECATED_1,
COM_STATISTICS,
COM_PROCESS_INFO,
COM_CONNECT,
COM_PROCESS_KILL,
COM_DEBUG,
COM_PING,
COM_TIME,
COM_DELAYED_INSERT,
COM_CHANGE_USER,
COM_BINLOG_DUMP,
COM_TABLE_DUMP,
COM_CONNECT_OUT,
COM_REGISTER_SLAVE,
COM_STMT_PREPARE,
COM_STMT_EXECUTE,
COM_STMT_SEND_LONG_DATA,
COM_STMT_CLOSE,
COM_STMT_RESET,
COM_SET_OPTION,
COM_STMT_FETCH,
COM_DAEMON,
COM_BINLOG_DUMP_GTID,
COM_RESET_CONNECTION,
COM_END,
}
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, Eq, PartialEq, Debug)]
#[repr(u8)]
pub enum SessionStateType {
SESSION_TRACK_SYSTEM_VARIABLES,
SESSION_TRACK_SCHEMA,
SESSION_TRACK_STATE_CHANGE,
SESSION_TRACK_GTIDS,
SESSION_TRACK_TRANSACTION_CHARACTERISTICS,
SESSION_TRACK_TRANSACTION_STATE,
}
impl From<SessionStateType> for u8 {
fn from(x: SessionStateType) -> u8 {
x as u8
}
}
impl TryFrom<u8> for SessionStateType {
type Error = UnknownSessionStateType;
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
0x00 => Ok(SessionStateType::SESSION_TRACK_SYSTEM_VARIABLES),
0x01 => Ok(SessionStateType::SESSION_TRACK_SCHEMA),
0x02 => Ok(SessionStateType::SESSION_TRACK_STATE_CHANGE),
0x03 => Ok(SessionStateType::SESSION_TRACK_GTIDS),
0x04 => Ok(SessionStateType::SESSION_TRACK_TRANSACTION_CHARACTERISTICS),
0x05 => Ok(SessionStateType::SESSION_TRACK_TRANSACTION_STATE),
x => Err(UnknownSessionStateType(x)),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
#[error("Unknown session state type {}", _0)]
pub struct UnknownSessionStateType(pub u8);
#[derive(Clone, Copy, Eq, PartialEq, Debug, Hash)]
#[allow(non_camel_case_types)]
#[repr(u8)]
pub enum GeometryType {
GEOM_GEOMETRY,
GEOM_POINT,
GEOM_LINESTRING,
GEOM_POLYGON,
GEOM_MULTIPOINT,
GEOM_MULTILINESTRING,
GEOM_MULTIPOLYGON,
GEOM_GEOMETRYCOLLECTION,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)]
#[error("Unknown geometry type {}", _0)]
#[repr(transparent)]
pub struct UnknownGeometryType(pub u8);
impl From<UnknownGeometryType> for u8 {
fn from(x: UnknownGeometryType) -> Self {
x.0
}
}
impl TryFrom<u8> for GeometryType {
type Error = UnknownGeometryType;
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
0 => Ok(GeometryType::GEOM_GEOMETRY),
1 => Ok(GeometryType::GEOM_POINT),
2 => Ok(GeometryType::GEOM_LINESTRING),
3 => Ok(GeometryType::GEOM_POLYGON),
4 => Ok(GeometryType::GEOM_MULTIPOINT),
5 => Ok(GeometryType::GEOM_MULTILINESTRING),
6 => Ok(GeometryType::GEOM_MULTIPOLYGON),
7 => Ok(GeometryType::GEOM_GEOMETRYCOLLECTION),
x => Err(UnknownGeometryType(x)),
}
}
}
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, Eq, PartialEq, Debug, Hash)]
#[repr(u8)]
pub enum ColumnType {
MYSQL_TYPE_DECIMAL = 0,
MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT,
MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT,
MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL,
MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,
MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE,
MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME,
MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE,
MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_TIMESTAMP2,
MYSQL_TYPE_DATETIME2,
MYSQL_TYPE_TIME2,
MYSQL_TYPE_TYPED_ARRAY,
MYSQL_TYPE_UNKNOWN = 243,
MYSQL_TYPE_JSON = 245,
MYSQL_TYPE_NEWDECIMAL = 246,
MYSQL_TYPE_ENUM = 247,
MYSQL_TYPE_SET = 248,
MYSQL_TYPE_TINY_BLOB = 249,
MYSQL_TYPE_MEDIUM_BLOB = 250,
MYSQL_TYPE_LONG_BLOB = 251,
MYSQL_TYPE_BLOB = 252,
MYSQL_TYPE_VAR_STRING = 253,
MYSQL_TYPE_STRING = 254,
MYSQL_TYPE_GEOMETRY = 255,
}
impl ColumnType {
pub fn is_numeric_type(&self) -> bool {
use ColumnType::*;
matches!(
self,
MYSQL_TYPE_TINY
| MYSQL_TYPE_SHORT
| MYSQL_TYPE_INT24
| MYSQL_TYPE_LONG
| MYSQL_TYPE_LONGLONG
| MYSQL_TYPE_DECIMAL
| MYSQL_TYPE_NEWDECIMAL
| MYSQL_TYPE_FLOAT
| MYSQL_TYPE_DOUBLE
)
}
pub fn is_character_type(&self) -> bool {
use ColumnType::*;
matches!(
self,
MYSQL_TYPE_STRING | MYSQL_TYPE_VAR_STRING | MYSQL_TYPE_VARCHAR | MYSQL_TYPE_BLOB
)
}
pub fn is_enum_or_set_type(&self) -> bool {
use ColumnType::*;
matches!(self, MYSQL_TYPE_ENUM | MYSQL_TYPE_SET)
}
pub fn is_enum_type(&self) -> bool {
matches!(self, ColumnType::MYSQL_TYPE_ENUM)
}
pub fn is_set_type(&self) -> bool {
matches!(self, ColumnType::MYSQL_TYPE_SET)
}
pub fn is_geometry_type(&self) -> bool {
matches!(self, ColumnType::MYSQL_TYPE_GEOMETRY)
}
}
impl TryFrom<u8> for ColumnType {
type Error = UnknownColumnType;
fn try_from(value: u8) -> Result<Self, Self::Error> {
match value {
0x00_u8 => Ok(ColumnType::MYSQL_TYPE_DECIMAL),
0x01_u8 => Ok(ColumnType::MYSQL_TYPE_TINY),
0x02_u8 => Ok(ColumnType::MYSQL_TYPE_SHORT),
0x03_u8 => Ok(ColumnType::MYSQL_TYPE_LONG),
0x04_u8 => Ok(ColumnType::MYSQL_TYPE_FLOAT),
0x05_u8 => Ok(ColumnType::MYSQL_TYPE_DOUBLE),
0x06_u8 => Ok(ColumnType::MYSQL_TYPE_NULL),
0x07_u8 => Ok(ColumnType::MYSQL_TYPE_TIMESTAMP),
0x08_u8 => Ok(ColumnType::MYSQL_TYPE_LONGLONG),
0x09_u8 => Ok(ColumnType::MYSQL_TYPE_INT24),
0x0a_u8 => Ok(ColumnType::MYSQL_TYPE_DATE),
0x0b_u8 => Ok(ColumnType::MYSQL_TYPE_TIME),
0x0c_u8 => Ok(ColumnType::MYSQL_TYPE_DATETIME),
0x0d_u8 => Ok(ColumnType::MYSQL_TYPE_YEAR),
0x0f_u8 => Ok(ColumnType::MYSQL_TYPE_VARCHAR),
0x10_u8 => Ok(ColumnType::MYSQL_TYPE_BIT),
0x11_u8 => Ok(ColumnType::MYSQL_TYPE_TIMESTAMP2),
0x12_u8 => Ok(ColumnType::MYSQL_TYPE_DATETIME2),
0x13_u8 => Ok(ColumnType::MYSQL_TYPE_TIME2),
0x14_u8 => Ok(ColumnType::MYSQL_TYPE_TYPED_ARRAY),
0xf3_u8 => Ok(ColumnType::MYSQL_TYPE_UNKNOWN),
0xf5_u8 => Ok(ColumnType::MYSQL_TYPE_JSON),
0xf6_u8 => Ok(ColumnType::MYSQL_TYPE_NEWDECIMAL),
0xf7_u8 => Ok(ColumnType::MYSQL_TYPE_ENUM),
0xf8_u8 => Ok(ColumnType::MYSQL_TYPE_SET),
0xf9_u8 => Ok(ColumnType::MYSQL_TYPE_TINY_BLOB),
0xfa_u8 => Ok(ColumnType::MYSQL_TYPE_MEDIUM_BLOB),
0xfb_u8 => Ok(ColumnType::MYSQL_TYPE_LONG_BLOB),
0xfc_u8 => Ok(ColumnType::MYSQL_TYPE_BLOB),
0xfd_u8 => Ok(ColumnType::MYSQL_TYPE_VAR_STRING),
0xfe_u8 => Ok(ColumnType::MYSQL_TYPE_STRING),
0xff_u8 => Ok(ColumnType::MYSQL_TYPE_GEOMETRY),
x => Err(UnknownColumnType(x)),
}
}
}
impl From<ColumnType> for u8 {
fn from(val: ColumnType) -> u8 {
val as u8
}
}
my_bitflags! {
Flags2,
#[error("Unknown flags in the raw value of Flags2 (raw={:b})", _0)]
UnknownFlags2,
u32,
pub struct Flags2: u32 {
const OPTION_AUTO_IS_NULL = 0x00004000;
const OPTION_NOT_AUTOCOMMIT = 0x00080000;
const OPTION_NO_FOREIGN_KEY_CHECKS = 0x04000000;
const OPTION_RELAXED_UNIQUE_CHECKS = 0x08000000;
}
}
my_bitflags! {
SqlMode,
#[error("Unknown flags in the raw value of SqlMode (raw={:b})", _0)]
UnknownSqlMode,
u64,
pub struct SqlMode: u64 {
const MODE_REAL_AS_FLOAT = 0x00000001;
const MODE_PIPES_AS_CONCAT = 0x00000002;
const MODE_ANSI_QUOTES = 0x00000004;
const MODE_IGNORE_SPACE = 0x00000008;
const MODE_NOT_USED = 0x00000010;
const MODE_ONLY_FULL_GROUP_BY = 0x00000020;
const MODE_NO_UNSIGNED_SUBTRACTION = 0x00000040;
const MODE_NO_DIR_IN_CREATE = 0x00000080;
const MODE_POSTGRESQL = 0x00000100;
const MODE_ORACLE = 0x00000200;
const MODE_MSSQL = 0x00000400;
const MODE_DB2 = 0x00000800;
const MODE_MAXDB = 0x00001000;
const MODE_NO_KEY_OPTIONS = 0x00002000;
const MODE_NO_FIELD_OPTIONS = 0x00008000;
const MODE_NO_TABLE_OPTIONS = 0x00004000;
const MODE_MYSQL40 = 0x00020000;
const MODE_MYSQL323 = 0x00010000;
const MODE_ANSI = 0x00040000;
const MODE_NO_AUTO_VALUE_ON_ZERO = 0x00080000;
const MODE_NO_BACKSLASH_ESCAPES = 0x00100000;
const MODE_STRICT_TRANS_TABLES = 0x00200000;
const MODE_STRICT_ALL_TABLES = 0x00400000;
const MODE_NO_ZERO_IN_DATE = 0x00800000;
const MODE_NO_ZERO_DATE = 0x01000000;
const MODE_INVALID_DATES = 0x02000000;
const MODE_ERROR_FOR_DIVISION_BY_ZERO = 0x04000000;
const MODE_TRADITIONAL = 0x08000000;
const MODE_NO_AUTO_CREATE_USER = 0x10000000;
const MODE_HIGH_NOT_PRECEDENCE = 0x20000000;
const MODE_NO_ENGINE_SUBSTITUTION = 0x40000000;
const MODE_PAD_CHAR_TO_FULL_LENGTH = 0x80000000;
const MODE_TIME_TRUNCATE_FRACTIONAL = 0x100000000;
const MODE_LAST = 0x200000000;
}
}
#[derive(Debug, Clone, Copy, Eq, PartialEq, Hash)]
#[allow(non_camel_case_types)]
#[repr(i8)]
pub enum ItemResult {
INVALID_RESULT = -1,
STRING_RESULT = 0,
REAL_RESULT,
INT_RESULT,
ROW_RESULT,
DECIMAL_RESULT,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, thiserror::Error)]
#[error("Unknown item result type {}", _0)]
pub struct UnknownItemResultType(pub i8);
impl From<UnknownItemResultType> for i8 {
fn from(x: UnknownItemResultType) -> Self {
x.0
}
}
impl TryFrom<i8> for ItemResult {
type Error = UnknownItemResultType;
fn try_from(value: i8) -> Result<Self, Self::Error> {
match value {
-1 => Ok(ItemResult::INVALID_RESULT),
0 => Ok(ItemResult::STRING_RESULT),
1 => Ok(ItemResult::REAL_RESULT),
2 => Ok(ItemResult::INT_RESULT),
3 => Ok(ItemResult::ROW_RESULT),
4 => Ok(ItemResult::DECIMAL_RESULT),
x => Err(UnknownItemResultType(x)),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, thiserror::Error)]
#[error("Unknown column type {}", _0)]
pub struct UnknownColumnType(pub u8);
impl From<UnknownColumnType> for u8 {
fn from(x: UnknownColumnType) -> Self {
x.0
}
}