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
use glib::translate::*;
use std::fmt;
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "JSCCheckSyntaxMode")]
pub enum CheckSyntaxMode {
#[doc(alias = "JSC_CHECK_SYNTAX_MODE_SCRIPT")]
Script,
#[doc(alias = "JSC_CHECK_SYNTAX_MODE_MODULE")]
Module,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CheckSyntaxMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CheckSyntaxMode::{}",
match *self {
Self::Script => "Script",
Self::Module => "Module",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CheckSyntaxMode {
type GlibType = ffi::JSCCheckSyntaxMode;
fn into_glib(self) -> ffi::JSCCheckSyntaxMode {
match self {
Self::Script => ffi::JSC_CHECK_SYNTAX_MODE_SCRIPT,
Self::Module => ffi::JSC_CHECK_SYNTAX_MODE_MODULE,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::JSCCheckSyntaxMode> for CheckSyntaxMode {
unsafe fn from_glib(value: ffi::JSCCheckSyntaxMode) -> Self {
match value {
ffi::JSC_CHECK_SYNTAX_MODE_SCRIPT => Self::Script,
ffi::JSC_CHECK_SYNTAX_MODE_MODULE => Self::Module,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "JSCCheckSyntaxResult")]
pub enum CheckSyntaxResult {
#[doc(alias = "JSC_CHECK_SYNTAX_RESULT_SUCCESS")]
Success,
#[doc(alias = "JSC_CHECK_SYNTAX_RESULT_RECOVERABLE_ERROR")]
RecoverableError,
#[doc(alias = "JSC_CHECK_SYNTAX_RESULT_IRRECOVERABLE_ERROR")]
IrrecoverableError,
#[doc(alias = "JSC_CHECK_SYNTAX_RESULT_UNTERMINATED_LITERAL_ERROR")]
UnterminatedLiteralError,
#[doc(alias = "JSC_CHECK_SYNTAX_RESULT_OUT_OF_MEMORY_ERROR")]
OutOfMemoryError,
#[doc(alias = "JSC_CHECK_SYNTAX_RESULT_STACK_OVERFLOW_ERROR")]
StackOverflowError,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for CheckSyntaxResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"CheckSyntaxResult::{}",
match *self {
Self::Success => "Success",
Self::RecoverableError => "RecoverableError",
Self::IrrecoverableError => "IrrecoverableError",
Self::UnterminatedLiteralError => "UnterminatedLiteralError",
Self::OutOfMemoryError => "OutOfMemoryError",
Self::StackOverflowError => "StackOverflowError",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for CheckSyntaxResult {
type GlibType = ffi::JSCCheckSyntaxResult;
fn into_glib(self) -> ffi::JSCCheckSyntaxResult {
match self {
Self::Success => ffi::JSC_CHECK_SYNTAX_RESULT_SUCCESS,
Self::RecoverableError => ffi::JSC_CHECK_SYNTAX_RESULT_RECOVERABLE_ERROR,
Self::IrrecoverableError => ffi::JSC_CHECK_SYNTAX_RESULT_IRRECOVERABLE_ERROR,
Self::UnterminatedLiteralError => ffi::JSC_CHECK_SYNTAX_RESULT_UNTERMINATED_LITERAL_ERROR,
Self::OutOfMemoryError => ffi::JSC_CHECK_SYNTAX_RESULT_OUT_OF_MEMORY_ERROR,
Self::StackOverflowError => ffi::JSC_CHECK_SYNTAX_RESULT_STACK_OVERFLOW_ERROR,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::JSCCheckSyntaxResult> for CheckSyntaxResult {
unsafe fn from_glib(value: ffi::JSCCheckSyntaxResult) -> Self {
match value {
ffi::JSC_CHECK_SYNTAX_RESULT_SUCCESS => Self::Success,
ffi::JSC_CHECK_SYNTAX_RESULT_RECOVERABLE_ERROR => Self::RecoverableError,
ffi::JSC_CHECK_SYNTAX_RESULT_IRRECOVERABLE_ERROR => Self::IrrecoverableError,
ffi::JSC_CHECK_SYNTAX_RESULT_UNTERMINATED_LITERAL_ERROR => Self::UnterminatedLiteralError,
ffi::JSC_CHECK_SYNTAX_RESULT_OUT_OF_MEMORY_ERROR => Self::OutOfMemoryError,
ffi::JSC_CHECK_SYNTAX_RESULT_STACK_OVERFLOW_ERROR => Self::StackOverflowError,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "JSCOptionType")]
pub enum OptionType {
#[doc(alias = "JSC_OPTION_BOOLEAN")]
Boolean,
#[doc(alias = "JSC_OPTION_INT")]
Int,
#[doc(alias = "JSC_OPTION_UINT")]
Uint,
#[doc(alias = "JSC_OPTION_SIZE")]
Size,
#[doc(alias = "JSC_OPTION_DOUBLE")]
Double,
#[doc(alias = "JSC_OPTION_STRING")]
String,
#[doc(alias = "JSC_OPTION_RANGE_STRING")]
RangeString,
#[doc(hidden)]
__Unknown(i32),
}
impl fmt::Display for OptionType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"OptionType::{}",
match *self {
Self::Boolean => "Boolean",
Self::Int => "Int",
Self::Uint => "Uint",
Self::Size => "Size",
Self::Double => "Double",
Self::String => "String",
Self::RangeString => "RangeString",
_ => "Unknown",
}
)
}
}
#[doc(hidden)]
impl IntoGlib for OptionType {
type GlibType = ffi::JSCOptionType;
fn into_glib(self) -> ffi::JSCOptionType {
match self {
Self::Boolean => ffi::JSC_OPTION_BOOLEAN,
Self::Int => ffi::JSC_OPTION_INT,
Self::Uint => ffi::JSC_OPTION_UINT,
Self::Size => ffi::JSC_OPTION_SIZE,
Self::Double => ffi::JSC_OPTION_DOUBLE,
Self::String => ffi::JSC_OPTION_STRING,
Self::RangeString => ffi::JSC_OPTION_RANGE_STRING,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::JSCOptionType> for OptionType {
unsafe fn from_glib(value: ffi::JSCOptionType) -> Self {
match value {
ffi::JSC_OPTION_BOOLEAN => Self::Boolean,
ffi::JSC_OPTION_INT => Self::Int,
ffi::JSC_OPTION_UINT => Self::Uint,
ffi::JSC_OPTION_SIZE => Self::Size,
ffi::JSC_OPTION_DOUBLE => Self::Double,
ffi::JSC_OPTION_STRING => Self::String,
ffi::JSC_OPTION_RANGE_STRING => Self::RangeString,
value => Self::__Unknown(value),
}
}
}