y-rb 0.2.0-x86_64-linux → 0.3.0-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/yrb/Cargo.toml +1 -1
- data/ext/yrb/src/awareness.rs +26 -41
- data/ext/yrb/src/lib.rs +87 -152
- data/ext/yrb/src/utils.rs +1 -3
- data/ext/yrb/src/yany.rs +1 -1
- data/ext/yrb/src/yarray.rs +24 -54
- data/ext/yrb/src/yawareness.rs +10 -18
- data/ext/yrb/src/ydoc.rs +2 -6
- data/ext/yrb/src/ymap.rs +18 -35
- data/ext/yrb/src/ytext.rs +29 -56
- data/ext/yrb/src/ytransaction.rs +2 -8
- data/ext/yrb/src/yvalue.rs +5 -11
- data/ext/yrb/src/yxml_element.rs +44 -65
- data/ext/yrb/src/yxml_text.rs +26 -47
- data/lib/2.7/yrb.so +0 -0
- data/lib/3.0/yrb.so +0 -0
- data/lib/3.1/yrb.so +0 -0
- data/lib/y/array.rb +2 -0
- data/lib/y/awareness.rb +7 -2
- data/lib/y/doc.rb +1 -1
- data/lib/y/map.rb +2 -0
- data/lib/y/text.rb +1 -1
- data/lib/y/version.rb +1 -1
- data/lib/y/xml.rb +5 -2
- data/lib/y-rb.rb +2 -0
- metadata +5 -5
data/ext/yrb/src/lib.rs
CHANGED
@@ -39,61 +39,40 @@ fn init() -> Result<(), Error> {
|
|
39
39
|
.define_private_method("yarray_get", method!(YArray::yarray_get, 1))
|
40
40
|
.expect("cannot define private method: yarray_get");
|
41
41
|
yarray
|
42
|
-
.define_private_method(
|
43
|
-
"yarray_insert",
|
44
|
-
method!(YArray::yarray_insert, 3)
|
45
|
-
)
|
42
|
+
.define_private_method("yarray_insert", method!(YArray::yarray_insert, 3))
|
46
43
|
.expect("cannot define private method: yarray_insert");
|
47
44
|
yarray
|
48
45
|
.define_private_method(
|
49
46
|
"yarray_insert_range",
|
50
|
-
method!(YArray::yarray_insert_range, 3)
|
47
|
+
method!(YArray::yarray_insert_range, 3),
|
51
48
|
)
|
52
49
|
.expect("cannot define private method: yarray_insert_range");
|
53
50
|
yarray
|
54
|
-
.define_private_method(
|
55
|
-
"yarray_length",
|
56
|
-
method!(YArray::yarray_length, 0)
|
57
|
-
)
|
51
|
+
.define_private_method("yarray_length", method!(YArray::yarray_length, 0))
|
58
52
|
.expect("cannot define private method: yarray_length");
|
59
53
|
yarray
|
60
|
-
.define_private_method(
|
61
|
-
"yarray_observe",
|
62
|
-
method!(YArray::yarray_observe, 1)
|
63
|
-
)
|
54
|
+
.define_private_method("yarray_observe", method!(YArray::yarray_observe, 1))
|
64
55
|
.expect("cannot define private method: yarray_observe");
|
65
56
|
yarray
|
66
|
-
.define_private_method(
|
67
|
-
"yarray_push_back",
|
68
|
-
method!(YArray::yarray_push_back, 2)
|
69
|
-
)
|
57
|
+
.define_private_method("yarray_push_back", method!(YArray::yarray_push_back, 2))
|
70
58
|
.expect("cannot define private method: yarray_push_back");
|
71
59
|
yarray
|
72
|
-
.define_private_method(
|
73
|
-
"yarray_push_front",
|
74
|
-
method!(YArray::yarray_push_front, 2)
|
75
|
-
)
|
60
|
+
.define_private_method("yarray_push_front", method!(YArray::yarray_push_front, 2))
|
76
61
|
.expect("cannot define private method: yarray_push_front");
|
77
62
|
yarray
|
78
|
-
.define_private_method(
|
79
|
-
"yarray_remove",
|
80
|
-
method!(YArray::yarray_remove, 2)
|
81
|
-
)
|
63
|
+
.define_private_method("yarray_remove", method!(YArray::yarray_remove, 2))
|
82
64
|
.expect("cannot define private method: yarray_remove");
|
83
65
|
yarray
|
84
66
|
.define_private_method(
|
85
67
|
"yarray_remove_range",
|
86
|
-
method!(YArray::yarray_remove_range, 3)
|
68
|
+
method!(YArray::yarray_remove_range, 3),
|
87
69
|
)
|
88
70
|
.expect("cannot define private method: yarray_remove_range");
|
89
71
|
yarray
|
90
72
|
.define_private_method("yarray_to_a", method!(YArray::yarray_to_a, 0))
|
91
73
|
.expect("cannot define private method: yarray_to_a");
|
92
74
|
yarray
|
93
|
-
.define_private_method(
|
94
|
-
"yarray_unobserve",
|
95
|
-
method!(YArray::yarray_unobserve, 1)
|
96
|
-
)
|
75
|
+
.define_private_method("yarray_unobserve", method!(YArray::yarray_unobserve, 1))
|
97
76
|
.expect("cannot define private method: yarray_unobserve");
|
98
77
|
|
99
78
|
let ydoc = module
|
@@ -101,16 +80,10 @@ fn init() -> Result<(), Error> {
|
|
101
80
|
.expect("cannot define class Y::Doc");
|
102
81
|
ydoc.define_singleton_method("new", function!(YDoc::ydoc_new, -1))
|
103
82
|
.expect("cannot define singleton method: ydoc_new");
|
104
|
-
ydoc.define_private_method(
|
105
|
-
"ydoc_transact"
|
106
|
-
|
107
|
-
|
108
|
-
.expect("cannot define private method: ydoc_transact");
|
109
|
-
ydoc.define_private_method(
|
110
|
-
"ydoc_encode_diff_v1",
|
111
|
-
method!(YDoc::ydoc_encode_diff_v1, 1)
|
112
|
-
)
|
113
|
-
.expect("cannot define private method: ydoc_encode_diff_v1");
|
83
|
+
ydoc.define_private_method("ydoc_transact", method!(YDoc::ydoc_transact, 0))
|
84
|
+
.expect("cannot define private method: ydoc_transact");
|
85
|
+
ydoc.define_private_method("ydoc_encode_diff_v1", method!(YDoc::ydoc_encode_diff_v1, 1))
|
86
|
+
.expect("cannot define private method: ydoc_encode_diff_v1");
|
114
87
|
|
115
88
|
let ymap = module
|
116
89
|
.define_class("Map", Default::default())
|
@@ -118,11 +91,8 @@ fn init() -> Result<(), Error> {
|
|
118
91
|
|
119
92
|
ymap.define_private_method("ymap_clear", method!(YMap::ymap_clear, 1))
|
120
93
|
.expect("cannot define private method: ymap_clear");
|
121
|
-
ymap.define_private_method(
|
122
|
-
"ymap_contains"
|
123
|
-
method!(YMap::ymap_contains, 1)
|
124
|
-
)
|
125
|
-
.expect("cannot define private method: ymap_contains");
|
94
|
+
ymap.define_private_method("ymap_contains", method!(YMap::ymap_contains, 1))
|
95
|
+
.expect("cannot define private method: ymap_contains");
|
126
96
|
ymap.define_private_method("ymap_each", method!(YMap::ymap_each, 1))
|
127
97
|
.expect("cannot define private method: ymap_each");
|
128
98
|
ymap.define_private_method("ymap_get", method!(YMap::ymap_get, 1))
|
@@ -137,11 +107,8 @@ fn init() -> Result<(), Error> {
|
|
137
107
|
.expect("cannot define private method: ymap_size");
|
138
108
|
ymap.define_private_method("ymap_to_h", method!(YMap::ymap_to_h, 0))
|
139
109
|
.expect("cannot define private method: ymap_to_h");
|
140
|
-
ymap.define_private_method(
|
141
|
-
"ymap_unobserve"
|
142
|
-
method!(YMap::ymap_unobserve, 1)
|
143
|
-
)
|
144
|
-
.expect("cannot define private method: ymap_unobserve");
|
110
|
+
ymap.define_private_method("ymap_unobserve", method!(YMap::ymap_unobserve, 1))
|
111
|
+
.expect("cannot define private method: ymap_unobserve");
|
145
112
|
|
146
113
|
let ytransaction = module
|
147
114
|
.define_class("Transaction", Default::default())
|
@@ -150,49 +117,49 @@ fn init() -> Result<(), Error> {
|
|
150
117
|
ytransaction
|
151
118
|
.define_private_method(
|
152
119
|
"ytransaction_apply_update",
|
153
|
-
method!(YTransaction::ytransaction_apply_update, 1)
|
120
|
+
method!(YTransaction::ytransaction_apply_update, 1),
|
154
121
|
)
|
155
122
|
.expect("cannot define private method: ytransaction_apply_update");
|
156
123
|
ytransaction
|
157
124
|
.define_private_method(
|
158
125
|
"ytransaction_commit",
|
159
|
-
method!(YTransaction::ytransaction_commit, 0)
|
126
|
+
method!(YTransaction::ytransaction_commit, 0),
|
160
127
|
)
|
161
128
|
.expect("cannot define private method: ytransaction_commit");
|
162
129
|
ytransaction
|
163
130
|
.define_private_method(
|
164
131
|
"ytransaction_get_array",
|
165
|
-
method!(YTransaction::ytransaction_get_array, 1)
|
132
|
+
method!(YTransaction::ytransaction_get_array, 1),
|
166
133
|
)
|
167
134
|
.expect("cannot define private method: ytransaction_get_array");
|
168
135
|
ytransaction
|
169
136
|
.define_private_method(
|
170
137
|
"ytransaction_get_map",
|
171
|
-
method!(YTransaction::ytransaction_get_map, 1)
|
138
|
+
method!(YTransaction::ytransaction_get_map, 1),
|
172
139
|
)
|
173
140
|
.expect("cannot define private method: ytransaction_get_mao");
|
174
141
|
ytransaction
|
175
142
|
.define_private_method(
|
176
143
|
"ytransaction_get_text",
|
177
|
-
method!(YTransaction::ytransaction_get_text, 1)
|
144
|
+
method!(YTransaction::ytransaction_get_text, 1),
|
178
145
|
)
|
179
146
|
.expect("cannot define private method: ytransaction_get_text");
|
180
147
|
ytransaction
|
181
148
|
.define_private_method(
|
182
149
|
"ytransaction_get_xml_element",
|
183
|
-
method!(YTransaction::ytransaction_get_xml_element, 1)
|
150
|
+
method!(YTransaction::ytransaction_get_xml_element, 1),
|
184
151
|
)
|
185
152
|
.expect("cannot define private method: ytransaction_get_xml_element");
|
186
153
|
ytransaction
|
187
154
|
.define_private_method(
|
188
155
|
"ytransaction_get_xml_text",
|
189
|
-
method!(YTransaction::ytransaction_get_xml_text, 1)
|
156
|
+
method!(YTransaction::ytransaction_get_xml_text, 1),
|
190
157
|
)
|
191
158
|
.expect("cannot define private method: ytransaction_get_xml_text");
|
192
159
|
ytransaction
|
193
160
|
.define_private_method(
|
194
161
|
"ytransaction_state_vector",
|
195
|
-
method!(YTransaction::ytransaction_state_vector, 0)
|
162
|
+
method!(YTransaction::ytransaction_state_vector, 0),
|
196
163
|
)
|
197
164
|
.expect("cannot define private method: ytransaction_state_vector");
|
198
165
|
|
@@ -207,51 +174,37 @@ fn init() -> Result<(), Error> {
|
|
207
174
|
.define_private_method("ytext_insert", method!(YText::ytext_insert, 3))
|
208
175
|
.expect("cannot define private method: ytext_insert");
|
209
176
|
ytext
|
210
|
-
.define_private_method(
|
211
|
-
"ytext_insert_embed",
|
212
|
-
method!(YText::ytext_insert_embed, 3)
|
213
|
-
)
|
177
|
+
.define_private_method("ytext_insert_embed", method!(YText::ytext_insert_embed, 3))
|
214
178
|
.expect("cannot define private method: ytext_insert_embed");
|
215
179
|
ytext
|
216
180
|
.define_private_method(
|
217
181
|
"ytext_insert_embed_with_attributes",
|
218
|
-
method!(YText::ytext_insert_embed_with_attributes, 4)
|
182
|
+
method!(YText::ytext_insert_embed_with_attributes, 4),
|
219
183
|
)
|
220
|
-
.expect(
|
221
|
-
"cannot define private method: ytext_insert_embed_with_attributes"
|
222
|
-
);
|
184
|
+
.expect("cannot define private method: ytext_insert_embed_with_attributes");
|
223
185
|
ytext
|
224
186
|
.define_private_method(
|
225
187
|
"ytext_insert_with_attributes",
|
226
|
-
method!(YText::ytext_insert_with_attributes, 4)
|
188
|
+
method!(YText::ytext_insert_with_attributes, 4),
|
227
189
|
)
|
228
190
|
.expect("cannot define private method: ytext_insert_with_attributes");
|
229
191
|
ytext
|
230
192
|
.define_private_method("ytext_length", method!(YText::ytext_length, 0))
|
231
193
|
.expect("cannot define private method: ytext_length");
|
232
194
|
ytext
|
233
|
-
.define_private_method(
|
234
|
-
"ytext_observe",
|
235
|
-
method!(YText::ytext_observe, 1)
|
236
|
-
)
|
195
|
+
.define_private_method("ytext_observe", method!(YText::ytext_observe, 1))
|
237
196
|
.expect("cannot define private method: ytext_observe");
|
238
197
|
ytext
|
239
198
|
.define_private_method("ytext_push", method!(YText::ytext_push, 2))
|
240
199
|
.expect("cannot define private method: ytext_push");
|
241
200
|
ytext
|
242
|
-
.define_private_method(
|
243
|
-
"ytext_remove_range",
|
244
|
-
method!(YText::ytext_remove_range, 3)
|
245
|
-
)
|
201
|
+
.define_private_method("ytext_remove_range", method!(YText::ytext_remove_range, 3))
|
246
202
|
.expect("cannot define private method: ytext_remove_range");
|
247
203
|
ytext
|
248
204
|
.define_private_method("ytext_to_s", method!(YText::ytext_to_s, 0))
|
249
205
|
.expect("cannot define private method: ytext_to_s");
|
250
206
|
ytext
|
251
|
-
.define_private_method(
|
252
|
-
"ytext_unobserve",
|
253
|
-
method!(YText::ytext_unobserve, 1)
|
254
|
-
)
|
207
|
+
.define_private_method("ytext_unobserve", method!(YText::ytext_unobserve, 1))
|
255
208
|
.expect("cannot define private method: ytext_unobserve");
|
256
209
|
|
257
210
|
let yxml_element = module
|
@@ -261,127 +214,127 @@ fn init() -> Result<(), Error> {
|
|
261
214
|
yxml_element
|
262
215
|
.define_private_method(
|
263
216
|
"yxml_element_attributes",
|
264
|
-
method!(YXmlElement::yxml_element_attributes, 0)
|
217
|
+
method!(YXmlElement::yxml_element_attributes, 0),
|
265
218
|
)
|
266
219
|
.expect("cannot define private method: yxml_element_attributes");
|
267
220
|
yxml_element
|
268
221
|
.define_private_method(
|
269
222
|
"yxml_element_first_child",
|
270
|
-
method!(YXmlElement::yxml_element_first_child, 0)
|
223
|
+
method!(YXmlElement::yxml_element_first_child, 0),
|
271
224
|
)
|
272
225
|
.expect("cannot define private method: yxml_element_first_child");
|
273
226
|
yxml_element
|
274
227
|
.define_private_method(
|
275
228
|
"yxml_element_get",
|
276
|
-
method!(YXmlElement::yxml_element_get, 1)
|
229
|
+
method!(YXmlElement::yxml_element_get, 1),
|
277
230
|
)
|
278
231
|
.expect("cannot define private method: yxml_element_get");
|
279
232
|
yxml_element
|
280
233
|
.define_private_method(
|
281
234
|
"yxml_element_get_attribute",
|
282
|
-
method!(YXmlElement::yxml_element_get_attribute, 1)
|
235
|
+
method!(YXmlElement::yxml_element_get_attribute, 1),
|
283
236
|
)
|
284
237
|
.expect("cannot define private method: yxml_element_get_attribute");
|
285
238
|
yxml_element
|
286
239
|
.define_private_method(
|
287
240
|
"yxml_element_insert_attribute",
|
288
|
-
method!(YXmlElement::yxml_element_insert_attribute, 3)
|
241
|
+
method!(YXmlElement::yxml_element_insert_attribute, 3),
|
289
242
|
)
|
290
243
|
.expect("cannot define private method: yxml_element_insert_attribute");
|
291
244
|
yxml_element
|
292
245
|
.define_private_method(
|
293
246
|
"yxml_element_insert_element",
|
294
|
-
method!(YXmlElement::yxml_element_insert_element, 3)
|
247
|
+
method!(YXmlElement::yxml_element_insert_element, 3),
|
295
248
|
)
|
296
249
|
.expect("cannot define private method: yxml_element_insert_element");
|
297
250
|
yxml_element
|
298
251
|
.define_private_method(
|
299
252
|
"yxml_element_insert_text",
|
300
|
-
method!(YXmlElement::yxml_element_insert_text, 2)
|
253
|
+
method!(YXmlElement::yxml_element_insert_text, 2),
|
301
254
|
)
|
302
255
|
.expect("cannot define private method: yxml_element_insert_text");
|
303
256
|
yxml_element
|
304
257
|
.define_private_method(
|
305
258
|
"yxml_element_next_sibling",
|
306
|
-
method!(YXmlElement::yxml_element_next_sibling, 0)
|
259
|
+
method!(YXmlElement::yxml_element_next_sibling, 0),
|
307
260
|
)
|
308
261
|
.expect("cannot define private method: yxml_element_next_sibling");
|
309
262
|
yxml_element
|
310
263
|
.define_private_method(
|
311
264
|
"yxml_element_observe",
|
312
|
-
method!(YXmlElement::yxml_element_observe, 1)
|
265
|
+
method!(YXmlElement::yxml_element_observe, 1),
|
313
266
|
)
|
314
267
|
.expect("cannot define private method: yxml_element_observe");
|
315
268
|
yxml_element
|
316
269
|
.define_private_method(
|
317
270
|
"yxml_element_parent",
|
318
|
-
method!(YXmlElement::yxml_element_parent, 0)
|
271
|
+
method!(YXmlElement::yxml_element_parent, 0),
|
319
272
|
)
|
320
273
|
.expect("cannot define private method: yxml_element_parent");
|
321
274
|
yxml_element
|
322
275
|
.define_private_method(
|
323
276
|
"yxml_element_prev_sibling",
|
324
|
-
method!(YXmlElement::yxml_element_prev_sibling, 0)
|
277
|
+
method!(YXmlElement::yxml_element_prev_sibling, 0),
|
325
278
|
)
|
326
279
|
.expect("cannot define private method: yxml_element_prev_sibling");
|
327
280
|
yxml_element
|
328
281
|
.define_private_method(
|
329
282
|
"yxml_element_push_elem_back",
|
330
|
-
method!(YXmlElement::yxml_element_push_element_back, 2)
|
283
|
+
method!(YXmlElement::yxml_element_push_element_back, 2),
|
331
284
|
)
|
332
285
|
.expect("cannot define private method: yxml_element_push_elem_back");
|
333
286
|
yxml_element
|
334
287
|
.define_private_method(
|
335
288
|
"yxml_element_push_elem_front",
|
336
|
-
method!(YXmlElement::yxml_element_push_element_front, 2)
|
289
|
+
method!(YXmlElement::yxml_element_push_element_front, 2),
|
337
290
|
)
|
338
291
|
.expect("cannot define private method: yxml_element_push_elem_front");
|
339
292
|
yxml_element
|
340
293
|
.define_private_method(
|
341
294
|
"yxml_element_push_text_back",
|
342
|
-
method!(YXmlElement::yxml_element_push_text_back, 1)
|
295
|
+
method!(YXmlElement::yxml_element_push_text_back, 1),
|
343
296
|
)
|
344
297
|
.expect("cannot define private method: yxml_element_push_text_back");
|
345
298
|
yxml_element
|
346
299
|
.define_private_method(
|
347
300
|
"yxml_element_push_text_front",
|
348
|
-
method!(YXmlElement::yxml_element_push_text_front, 1)
|
301
|
+
method!(YXmlElement::yxml_element_push_text_front, 1),
|
349
302
|
)
|
350
303
|
.expect("cannot define private method: yxml_element_push_text_front");
|
351
304
|
yxml_element
|
352
305
|
.define_private_method(
|
353
306
|
"yxml_element_remove_attribute",
|
354
|
-
method!(YXmlElement::yxml_element_remove_attribute, 2)
|
307
|
+
method!(YXmlElement::yxml_element_remove_attribute, 2),
|
355
308
|
)
|
356
309
|
.expect("cannot define private method: yxml_element_remove_range");
|
357
310
|
yxml_element
|
358
311
|
.define_private_method(
|
359
312
|
"yxml_element_remove_range",
|
360
|
-
method!(YXmlElement::yxml_element_remove_range, 3)
|
313
|
+
method!(YXmlElement::yxml_element_remove_range, 3),
|
361
314
|
)
|
362
315
|
.expect("cannot define private method: yxml_element_remove_range");
|
363
316
|
yxml_element
|
364
317
|
.define_private_method(
|
365
318
|
"yxml_element_size",
|
366
|
-
method!(YXmlElement::yxml_element_size, 0)
|
319
|
+
method!(YXmlElement::yxml_element_size, 0),
|
367
320
|
)
|
368
321
|
.expect("cannot define private method: yxml_element_size");
|
369
322
|
yxml_element
|
370
323
|
.define_private_method(
|
371
324
|
"yxml_element_tag",
|
372
|
-
method!(YXmlElement::yxml_element_tag, 0)
|
325
|
+
method!(YXmlElement::yxml_element_tag, 0),
|
373
326
|
)
|
374
327
|
.expect("cannot define private method: yxml_element_tag");
|
375
328
|
yxml_element
|
376
329
|
.define_private_method(
|
377
330
|
"yxml_element_to_s",
|
378
|
-
method!(YXmlElement::yxml_element_to_s, 0)
|
331
|
+
method!(YXmlElement::yxml_element_to_s, 0),
|
379
332
|
)
|
380
333
|
.expect("cannot define private method: yxml_element_to_s");
|
381
334
|
yxml_element
|
382
335
|
.define_private_method(
|
383
336
|
"yxml_element_unobserve",
|
384
|
-
method!(YXmlElement::yxml_element_unobserve, 1)
|
337
|
+
method!(YXmlElement::yxml_element_unobserve, 1),
|
385
338
|
)
|
386
339
|
.expect("cannot define private method: yxml_element_unobserve");
|
387
340
|
|
@@ -392,164 +345,146 @@ fn init() -> Result<(), Error> {
|
|
392
345
|
yxml_text
|
393
346
|
.define_private_method(
|
394
347
|
"yxml_text_attributes",
|
395
|
-
method!(YXmlText::yxml_text_attributes, 0)
|
348
|
+
method!(YXmlText::yxml_text_attributes, 0),
|
396
349
|
)
|
397
350
|
.expect("cannot define private method: yxml_text_attributes");
|
398
351
|
yxml_text
|
399
|
-
.define_private_method(
|
400
|
-
"yxml_text_format",
|
401
|
-
method!(YXmlText::yxml_text_format, 4)
|
402
|
-
)
|
352
|
+
.define_private_method("yxml_text_format", method!(YXmlText::yxml_text_format, 4))
|
403
353
|
.expect("cannot define private method: yxml_text_format");
|
404
354
|
yxml_text
|
405
355
|
.define_private_method(
|
406
356
|
"yxml_text_get_attribute",
|
407
|
-
method!(YXmlText::yxml_text_get_attribute, 1)
|
357
|
+
method!(YXmlText::yxml_text_get_attribute, 1),
|
408
358
|
)
|
409
359
|
.expect("cannot define private method: yxml_text_get_attribute");
|
410
360
|
yxml_text
|
411
|
-
.define_private_method(
|
412
|
-
"yxml_text_insert",
|
413
|
-
method!(YXmlText::yxml_text_insert, 3)
|
414
|
-
)
|
361
|
+
.define_private_method("yxml_text_insert", method!(YXmlText::yxml_text_insert, 3))
|
415
362
|
.expect("cannot define private method: yxml_text_insert");
|
416
363
|
yxml_text
|
417
364
|
.define_private_method(
|
418
365
|
"yxml_text_insert_attribute",
|
419
|
-
method!(YXmlText::yxml_text_insert_attribute, 3)
|
366
|
+
method!(YXmlText::yxml_text_insert_attribute, 3),
|
420
367
|
)
|
421
368
|
.expect("cannot define private method: yxml_text_insert_attribute");
|
422
|
-
yxml_text
|
369
|
+
yxml_text
|
370
|
+
.define_private_method(
|
371
|
+
"yxml_text_insert_embed_with_attrs",
|
372
|
+
method!(YXmlText::yxml_text_insert_embed_with_attributes, 4),
|
373
|
+
)
|
374
|
+
.expect("cannot define private method: yxml_text_insert_embed_with_attributes");
|
423
375
|
yxml_text
|
424
376
|
.define_private_method(
|
425
377
|
"yxml_text_insert_with_attrs",
|
426
|
-
method!(YXmlText::yxml_text_insert_with_attributes, 4)
|
378
|
+
method!(YXmlText::yxml_text_insert_with_attributes, 4),
|
427
379
|
)
|
428
|
-
.expect(
|
429
|
-
"cannot define private method: yxml_text_insert_with_attributes"
|
430
|
-
);
|
380
|
+
.expect("cannot define private method: yxml_text_insert_with_attributes");
|
431
381
|
yxml_text
|
432
382
|
.define_private_method(
|
433
383
|
"yxml_text_insert_embed",
|
434
|
-
method!(YXmlText::yxml_text_insert_embed, 3)
|
384
|
+
method!(YXmlText::yxml_text_insert_embed, 3),
|
435
385
|
)
|
436
386
|
.expect("cannot define private method: yxml_text_insert_embed");
|
437
387
|
yxml_text
|
438
|
-
.define_private_method(
|
439
|
-
"yxml_text_length",
|
440
|
-
method!(YXmlText::yxml_text_length, 0)
|
441
|
-
)
|
388
|
+
.define_private_method("yxml_text_length", method!(YXmlText::yxml_text_length, 0))
|
442
389
|
.expect("cannot define private method: yxml_text_length");
|
443
390
|
yxml_text
|
444
391
|
.define_private_method(
|
445
392
|
"yxml_text_next_sibling",
|
446
|
-
method!(YXmlText::yxml_text_next_sibling, 0)
|
393
|
+
method!(YXmlText::yxml_text_next_sibling, 0),
|
447
394
|
)
|
448
395
|
.expect("cannot define private method: yxml_text_next_sibling");
|
449
396
|
yxml_text
|
450
|
-
.define_private_method(
|
451
|
-
"yxml_text_parent",
|
452
|
-
method!(YXmlText::yxml_text_parent, 0)
|
453
|
-
)
|
397
|
+
.define_private_method("yxml_text_parent", method!(YXmlText::yxml_text_parent, 0))
|
454
398
|
.expect("cannot define private method: yxml_text_parent");
|
455
399
|
yxml_text
|
456
400
|
.define_private_method(
|
457
401
|
"yxml_text_prev_sibling",
|
458
|
-
method!(YXmlText::yxml_text_prev_sibling, 0)
|
402
|
+
method!(YXmlText::yxml_text_prev_sibling, 0),
|
459
403
|
)
|
460
404
|
.expect("cannot define private method: yxml_text_prev_sibling");
|
461
405
|
yxml_text
|
462
|
-
.define_private_method(
|
463
|
-
"yxml_text_push",
|
464
|
-
method!(YXmlText::yxml_text_push, 2)
|
465
|
-
)
|
406
|
+
.define_private_method("yxml_text_push", method!(YXmlText::yxml_text_push, 2))
|
466
407
|
.expect("cannot define private method: yxml_text_push");
|
467
408
|
yxml_text
|
468
409
|
.define_private_method(
|
469
410
|
"yxml_text_remove_range",
|
470
|
-
method!(YXmlText::yxml_text_remove_range, 3)
|
411
|
+
method!(YXmlText::yxml_text_remove_range, 3),
|
471
412
|
)
|
472
413
|
.expect("cannot define private method: yxml_text_remove_range");
|
473
414
|
yxml_text
|
474
|
-
.define_private_method(
|
475
|
-
"yxml_text_to_s",
|
476
|
-
method!(YXmlText::yxml_text_to_s, 0)
|
477
|
-
)
|
415
|
+
.define_private_method("yxml_text_to_s", method!(YXmlText::yxml_text_to_s, 0))
|
478
416
|
.expect("cannot define private method: yxml_text_to_s");
|
479
417
|
|
480
418
|
let yawareness = module
|
481
419
|
.define_class("Awareness", Default::default())
|
482
420
|
.expect("cannot define class Y::Awareness");
|
483
421
|
yawareness
|
484
|
-
.define_singleton_method(
|
485
|
-
"new",
|
486
|
-
function!(YAwareness::yawareness_new, 0)
|
487
|
-
)
|
422
|
+
.define_singleton_method("new", function!(YAwareness::yawareness_new, 0))
|
488
423
|
.expect("cannot define singleton method: yawareness_new");
|
489
424
|
yawareness
|
490
425
|
.define_private_method(
|
491
426
|
"yawareness_apply_update",
|
492
|
-
method!(YAwareness::yawareness_apply_update, 1)
|
427
|
+
method!(YAwareness::yawareness_apply_update, 1),
|
493
428
|
)
|
494
429
|
.expect("cannot define private method: yawareness_apply_update");
|
495
430
|
yawareness
|
496
431
|
.define_private_method(
|
497
432
|
"yawareness_clean_local_state",
|
498
|
-
method!(YAwareness::yawareness_clean_local_state, 0)
|
433
|
+
method!(YAwareness::yawareness_clean_local_state, 0),
|
499
434
|
)
|
500
435
|
.expect("cannot define private method: yawareness_clean_local_state");
|
501
436
|
yawareness
|
502
437
|
.define_private_method(
|
503
438
|
"yawareness_clients",
|
504
|
-
method!(YAwareness::yawareness_clients, 0)
|
439
|
+
method!(YAwareness::yawareness_clients, 0),
|
505
440
|
)
|
506
441
|
.expect("cannot define private method: yawareness_clients");
|
507
442
|
yawareness
|
508
443
|
.define_private_method(
|
509
444
|
"yawareness_client_id",
|
510
|
-
method!(YAwareness::yawareness_client_id, 0)
|
445
|
+
method!(YAwareness::yawareness_client_id, 0),
|
511
446
|
)
|
512
447
|
.expect("cannot define private method: yawareness_client_id");
|
513
448
|
yawareness
|
514
449
|
.define_private_method(
|
515
450
|
"yawareness_local_state",
|
516
|
-
method!(YAwareness::yawareness_local_state, 0)
|
451
|
+
method!(YAwareness::yawareness_local_state, 0),
|
517
452
|
)
|
518
453
|
.expect("cannot define private method: yawareness_local_state");
|
519
454
|
yawareness
|
520
455
|
.define_private_method(
|
521
456
|
"yawareness_on_update",
|
522
|
-
method!(YAwareness::yawareness_on_update, 1)
|
457
|
+
method!(YAwareness::yawareness_on_update, 1),
|
523
458
|
)
|
524
459
|
.expect("cannot define private method: yawareness_on_update");
|
525
460
|
yawareness
|
526
461
|
.define_private_method(
|
527
462
|
"yawareness_remove_on_update",
|
528
|
-
method!(YAwareness::yawareness_remove_on_update, 1)
|
463
|
+
method!(YAwareness::yawareness_remove_on_update, 1),
|
529
464
|
)
|
530
465
|
.expect("cannot define private method: yawareness_remove_on_update");
|
531
466
|
yawareness
|
532
467
|
.define_private_method(
|
533
468
|
"yawareness_remove_state",
|
534
|
-
method!(YAwareness::yawareness_remove_state, 1)
|
469
|
+
method!(YAwareness::yawareness_remove_state, 1),
|
535
470
|
)
|
536
471
|
.expect("cannot define private method: yawareness_remove_state");
|
537
472
|
yawareness
|
538
473
|
.define_private_method(
|
539
474
|
"yawareness_set_local_state",
|
540
|
-
method!(YAwareness::yawareness_set_local_state, 1)
|
475
|
+
method!(YAwareness::yawareness_set_local_state, 1),
|
541
476
|
)
|
542
477
|
.expect("cannot define private method: yawareness_set_local_state");
|
543
478
|
yawareness
|
544
479
|
.define_private_method(
|
545
480
|
"yawareness_update",
|
546
|
-
method!(YAwareness::yawareness_update, 0)
|
481
|
+
method!(YAwareness::yawareness_update, 0),
|
547
482
|
)
|
548
483
|
.expect("cannot define private method: yawareness_update");
|
549
484
|
yawareness
|
550
485
|
.define_private_method(
|
551
486
|
"yawareness_update_with_clients",
|
552
|
-
method!(YAwareness::yawareness_update_with_clients, 1)
|
487
|
+
method!(YAwareness::yawareness_update_with_clients, 1),
|
553
488
|
)
|
554
489
|
.expect("cannot define private method: yawareness_update_with_clients");
|
555
490
|
|
@@ -559,7 +494,7 @@ fn init() -> Result<(), Error> {
|
|
559
494
|
yawareness_update
|
560
495
|
.define_private_method(
|
561
496
|
"yawareness_update_encode",
|
562
|
-
method!(YAwarenessUpdate::yawareness_update_encode, 0)
|
497
|
+
method!(YAwarenessUpdate::yawareness_update_encode, 0),
|
563
498
|
)
|
564
499
|
.expect("cannot define private method: yawareness_update_encode");
|
565
500
|
|
data/ext/yrb/src/utils.rs
CHANGED
@@ -11,9 +11,7 @@ pub(crate) struct TypeConversionError;
|
|
11
11
|
pub(crate) fn indifferent_hash_key(key: Value) -> Option<String> {
|
12
12
|
RString::from_value(key)
|
13
13
|
.map(|v| v.to_string().unwrap())
|
14
|
-
.or_else(||
|
15
|
-
Symbol::from_value(key).map(|v| v.name().unwrap().to_string())
|
16
|
-
})
|
14
|
+
.or_else(|| Symbol::from_value(key).map(|v| v.name().unwrap().to_string()))
|
17
15
|
}
|
18
16
|
|
19
17
|
pub(crate) fn map_rhash_to_attrs(hash: RHash) -> Result<Attrs, Error> {
|
data/ext/yrb/src/yany.rs
CHANGED
@@ -38,7 +38,7 @@ impl TryInto<Value> for YAny {
|
|
38
38
|
Any::Number(v) => Ok(Value::from(v)),
|
39
39
|
Any::BigInt(v) => Ok(Value::from(v)),
|
40
40
|
Any::String(v) => Ok(Value::from(RString::from(v.borrow()))),
|
41
|
-
Any::Buffer(v) => Ok(Value::from(RString::from_slice(v.borrow())))
|
41
|
+
Any::Buffer(v) => Ok(Value::from(RString::from_slice(v.borrow()))),
|
42
42
|
};
|
43
43
|
}
|
44
44
|
}
|