@contentauth/c2pa-node 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,562 @@
1
+ // Copyright 2025 Adobe. All rights reserved.
2
+ // This file is licensed to you under the Apache License,
3
+ // Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
4
+ // or the MIT license (http://opensource.org/licenses/MIT),
5
+ // at your option.
6
+
7
+ // Unless required by applicable law or agreed to in writing,
8
+ // this software is distributed on an "AS IS" BASIS, WITHOUT
9
+ // WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or
10
+ // implied. See the LICENSE-MIT and LICENSE-APACHE files for the
11
+ // specific language governing permissions and limitations under
12
+ // each license.
13
+
14
+ use crate::asset::parse_asset;
15
+ use crate::error::{as_js_error, Error};
16
+ use crate::neon_identity_assertion_signer::NeonIdentityAssertionSigner;
17
+ use crate::neon_signer::{CallbackSignerConfig, NeonCallbackSigner, NeonLocalSigner};
18
+ use crate::runtime::runtime;
19
+ use c2pa::Builder;
20
+ use neon::prelude::*;
21
+ use neon_serde4;
22
+ use serde::{Deserialize, Serialize};
23
+ use serde_json;
24
+ use std::ops::Deref;
25
+ use std::sync::Arc;
26
+ use tokio::sync::Mutex;
27
+
28
+ #[derive(Default, Serialize, Deserialize)]
29
+ #[serde(rename_all = "camelCase")]
30
+ struct IngredientThumbnail {
31
+ pub format: String,
32
+ #[serde(with = "serde_bytes")]
33
+ pub data: Vec<u8>,
34
+ }
35
+
36
+ #[derive(Default, Serialize, Deserialize)]
37
+ #[serde(rename_all = "camelCase")]
38
+ struct IngredientOptions {
39
+ pub is_parent: bool,
40
+ pub thumbnail: Option<IngredientThumbnail>,
41
+ }
42
+
43
+ pub struct NeonBuilder {
44
+ builder: Arc<Mutex<Builder>>,
45
+ }
46
+
47
+ impl NeonBuilder {
48
+ pub fn new(mut cx: FunctionContext) -> JsResult<JsBox<Self>> {
49
+ Ok(cx.boxed(Self {
50
+ builder: Arc::new(Mutex::new(Builder::default())),
51
+ }))
52
+ }
53
+
54
+ pub fn with_json(mut cx: FunctionContext) -> JsResult<JsBox<Self>> {
55
+ let json = cx.argument::<JsString>(0)?.value(&mut cx);
56
+ let builder = Builder::from_json(&json).or_else(|err| cx.throw_error(err.to_string()))?;
57
+ Ok(cx.boxed(Self {
58
+ builder: Arc::new(Mutex::new(builder)),
59
+ }))
60
+ }
61
+
62
+ pub fn set_no_embed(mut cx: FunctionContext) -> JsResult<JsUndefined> {
63
+ let rt = runtime();
64
+ let this = cx.this::<JsBox<Self>>()?;
65
+ let no_embed = cx.argument::<JsBoolean>(0)?.value(&mut cx);
66
+ let mut builder = rt.block_on(async { this.builder.lock().await });
67
+ builder.no_embed = no_embed;
68
+ Ok(cx.undefined())
69
+ }
70
+
71
+ pub fn set_remote_url(mut cx: FunctionContext) -> JsResult<JsUndefined> {
72
+ let rt = runtime();
73
+ let this = cx.this::<JsBox<Self>>()?;
74
+ let remote_url: String = cx.argument::<JsString>(0)?.value(&mut cx);
75
+ let mut builder = rt.block_on(async { this.builder.lock().await });
76
+ builder.set_remote_url(&remote_url);
77
+ Ok(cx.undefined())
78
+ }
79
+
80
+ pub fn add_assertion(mut cx: FunctionContext) -> JsResult<JsUndefined> {
81
+ let rt = runtime();
82
+ let this = cx.this::<JsBox<Self>>()?;
83
+ let label = cx.argument::<JsString>(0)?.value(&mut cx);
84
+ let assertion_kind = cx.argument_opt(2).and_then(|js_value| {
85
+ js_value
86
+ .downcast::<JsString, _>(&mut cx)
87
+ .ok()
88
+ .map(|js_string| js_string.value(&mut cx))
89
+ });
90
+
91
+ let mut builder = rt.block_on(async { this.builder.lock().await });
92
+
93
+ if let Some("Json") = assertion_kind.as_deref() {
94
+ // For Json, expect the assertion as a string (JSON) and parse it
95
+ let assertion_str = cx.argument::<JsString>(1)?.value(&mut cx);
96
+ let assertion: serde_json::Value = serde_json::from_str(&assertion_str)
97
+ .or_else(|err| cx.throw_error(format!("Invalid JSON: {}", err)))?;
98
+ builder
99
+ .add_assertion(&label, &assertion)
100
+ .or_else(|err| cx.throw_error(err.to_string()))?;
101
+ } else {
102
+ // For Cbor/Binary/Uri, expect the assertion as an object and serialize to CBOR
103
+ let assertion_obj = cx.argument::<JsValue>(1)?;
104
+ let assertion: serde_json::Value = neon_serde4::from_value(&mut cx, assertion_obj)
105
+ .or_else(|err| cx.throw_error(err.to_string()))?;
106
+ builder
107
+ .add_assertion(&label, &assertion)
108
+ .or_else(|err| cx.throw_error(err.to_string()))?;
109
+ };
110
+
111
+ Ok(cx.undefined())
112
+ }
113
+
114
+ pub fn add_resource(mut cx: FunctionContext) -> JsResult<JsPromise> {
115
+ let rt = runtime();
116
+ let this = cx.this::<JsBox<Self>>()?;
117
+ let uri = cx.argument::<JsString>(0)?.value(&mut cx);
118
+ let resource = cx
119
+ .argument::<JsObject>(1)
120
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
121
+ let builder = Arc::clone(&this.builder);
122
+
123
+ let channel = cx.channel();
124
+ let (deferred, promise) = cx.promise();
125
+
126
+ rt.spawn(async move {
127
+ let mut builder = builder.lock().await;
128
+
129
+ let result = resource.into_read_stream().and_then(|mut resource_stream| {
130
+ builder.add_resource(&uri, &mut resource_stream)?;
131
+ Ok(())
132
+ });
133
+
134
+ deferred.settle_with(&channel, |mut cx| match result {
135
+ Ok(_) => Ok(cx.undefined()),
136
+ Err(err) => as_js_error(&mut cx, err).and_then(|err| cx.throw(err)),
137
+ });
138
+ });
139
+
140
+ Ok(promise)
141
+ }
142
+
143
+ pub fn add_ingredient(mut cx: FunctionContext) -> JsResult<JsPromise> {
144
+ let rt = runtime();
145
+ let this = cx.this::<JsBox<Self>>()?;
146
+ let ingredient_json = cx.argument::<JsString>(0)?.value(&mut cx);
147
+ let ingredient = cx
148
+ .argument::<JsObject>(1)
149
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
150
+
151
+ let builder = Arc::clone(&this.builder);
152
+
153
+ let channel = cx.channel();
154
+ let (deferred, promise) = cx.promise();
155
+
156
+ rt.spawn(async move {
157
+ let mut builder = builder.lock().await;
158
+
159
+ let result = ingredient
160
+ .mime_type()
161
+ .ok_or_else(|| Error::Signing("Ingredient asset must have a mime type".to_string()))
162
+ .and_then(|format| {
163
+ let mut ingredient_stream = ingredient.into_read_stream()?;
164
+ builder.add_ingredient_from_stream(
165
+ &ingredient_json,
166
+ &format,
167
+ &mut ingredient_stream,
168
+ )?;
169
+ Ok(())
170
+ });
171
+
172
+ deferred.settle_with(&channel, move |mut cx| match result {
173
+ Ok(_) => Ok(cx.undefined()),
174
+ Err(err) => as_js_error(&mut cx, err).and_then(|err| cx.throw(err)),
175
+ });
176
+ });
177
+
178
+ Ok(promise)
179
+ }
180
+
181
+ pub fn to_archive(mut cx: FunctionContext) -> JsResult<JsPromise> {
182
+ let rt = runtime();
183
+ let this = cx.this::<JsBox<Self>>()?;
184
+ let dest = cx
185
+ .argument::<JsObject>(0)
186
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
187
+ let builder = Arc::clone(&this.builder);
188
+
189
+ let channel = cx.channel();
190
+ let (deferred, promise) = cx.promise();
191
+
192
+ rt.spawn(async move {
193
+ let mut builder = builder.lock().await;
194
+ let result = dest.write_stream().and_then(|dest_stream| {
195
+ builder.to_archive(dest_stream)?;
196
+ Ok(())
197
+ });
198
+
199
+ deferred.settle_with(&channel, move |mut cx| match result {
200
+ Ok(_) => Ok(cx.undefined()),
201
+ Err(err) => as_js_error(&mut cx, err).and_then(|err| cx.throw(err)),
202
+ });
203
+ });
204
+ Ok(promise)
205
+ }
206
+
207
+ pub fn from_archive(mut cx: FunctionContext) -> JsResult<JsPromise> {
208
+ let rt = runtime();
209
+ let source = cx
210
+ .argument::<JsObject>(0)
211
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
212
+
213
+ let channel = cx.channel();
214
+ let (deferred, promise) = cx.promise();
215
+
216
+ rt.spawn(async move {
217
+ let result = source.into_read_stream().and_then(|source_stream| {
218
+ let builder = Builder::from_archive(source_stream)?;
219
+ Ok(builder)
220
+ });
221
+
222
+ deferred.settle_with(&channel, move |mut cx| match result {
223
+ Ok(builder) => Ok(cx.boxed(Self {
224
+ builder: Arc::new(Mutex::new(builder)),
225
+ })),
226
+ Err(err) => as_js_error(&mut cx, err).and_then(|err| cx.throw(err)),
227
+ });
228
+ });
229
+ Ok(promise)
230
+ }
231
+
232
+ pub fn sign(mut cx: FunctionContext) -> JsResult<JsBuffer> {
233
+ let rt = runtime();
234
+ let this = cx.this::<JsBox<Self>>()?;
235
+ let signer = cx.argument::<JsBox<NeonLocalSigner>>(0)?;
236
+ let input = cx
237
+ .argument::<JsObject>(1)
238
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
239
+ let output_obj = cx.argument::<JsObject>(2)?;
240
+ let output = parse_asset(&mut cx, output_obj)?;
241
+ let mut builder = rt.block_on(async { this.builder.lock().await });
242
+ let signer = signer.signer();
243
+ let format = match input.mime_type() {
244
+ Some(mime_type) => mime_type.to_owned(),
245
+ None => return cx.throw_error("Input asset must have a mime type"),
246
+ };
247
+ let mut input_stream = input
248
+ .into_read_stream()
249
+ .or_else(|err| cx.throw_error(err.to_string()))?;
250
+ let mut output_stream = output
251
+ .write_stream()
252
+ .or_else(|err| cx.throw_error(err.to_string()))?;
253
+ let bytes = builder
254
+ .sign(&**signer, &format, &mut input_stream, &mut output_stream)
255
+ .or_else(|err| cx.throw_error(err.to_string()))?;
256
+
257
+ // If the output is a buffer, write the signed asset to it
258
+ // Create a new JsBuffer with the contents of output_stream
259
+ if output.name() == "destination_buffer" {
260
+ let mut signed_asset = Vec::new();
261
+ output_stream
262
+ .rewind()
263
+ .or_else(|e| cx.throw_error(format!("Failed to rewind stream: {e}")))?;
264
+ output_stream
265
+ .read_to_end(&mut signed_asset)
266
+ .or_else(|e| cx.throw_error(format!("Failed to read stream: {e}")))?;
267
+ let buffer = JsBuffer::from_slice(&mut cx, &signed_asset)?;
268
+ // Set the new JsBuffer on the output JsObject
269
+ output_obj.set(&mut cx, "buffer", buffer)?;
270
+ }
271
+
272
+ let buffer = JsBuffer::from_slice(&mut cx, bytes.as_slice())?;
273
+ Ok(buffer)
274
+ }
275
+
276
+ // TODO: This mimics the previous c2pa-node iteration's arguments.
277
+ // It is probably redundant with sign_async.
278
+ pub fn sign_config_async(mut cx: FunctionContext) -> JsResult<JsPromise> {
279
+ let rt = runtime();
280
+ let channel = cx.channel();
281
+
282
+ let this = cx.this::<JsBox<Self>>()?;
283
+ let callback = cx.argument::<JsFunction>(0)?;
284
+ let rooted_callback: Arc<Root<JsFunction>> = Arc::new(Root::new(&mut cx, &callback));
285
+ let js_config = cx.argument::<JsObject>(1)?;
286
+ let config = CallbackSignerConfig::from_js_config(&mut cx, js_config)?;
287
+ let signer = NeonCallbackSigner::new(cx.channel(), rooted_callback, (**config).clone());
288
+
289
+ let input = cx
290
+ .argument::<JsObject>(2)
291
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
292
+ let output_obj = cx.argument::<JsObject>(3)?;
293
+ let output = parse_asset(&mut cx, output_obj)?;
294
+ let format = match input.mime_type() {
295
+ Some(mime_type) => mime_type.to_owned(),
296
+ None => return cx.throw_error("Input asset must have a mime type"),
297
+ };
298
+ let mut input_stream = input
299
+ .into_read_stream()
300
+ .or_else(|err| cx.throw_error(err.to_string()))?;
301
+ let mut output_stream = output
302
+ .write_stream()
303
+ .or_else(|err| cx.throw_error(err.to_string()))?;
304
+
305
+ let builder = Arc::clone(&this.builder);
306
+ let (deferred, promise) = cx.promise();
307
+ rt.spawn(async move {
308
+ let result = builder
309
+ .lock()
310
+ .await
311
+ .sign_async(&signer, &format, &mut input_stream, &mut output_stream)
312
+ .await
313
+ .map(|sign_result| (sign_result, output_stream));
314
+
315
+ deferred.settle_with(&channel, move |mut cx| match result {
316
+ Ok((signed_bytes, mut output_stream)) => {
317
+ let signed_asset = if output.name() == "destination_buffer" {
318
+ let mut buffer = Vec::new();
319
+ match output_stream.rewind() {
320
+ Ok(_) => (),
321
+ Err(e) => {
322
+ return cx.throw_error(format!("Failed to rewind stream: {e}"))
323
+ }
324
+ }
325
+ match output_stream.read_to_end(&mut buffer) {
326
+ Ok(_) => (),
327
+ Err(e) => return cx.throw_error(format!("Failed to read stream: {e}")),
328
+ }
329
+ Some(buffer)
330
+ } else {
331
+ None
332
+ };
333
+
334
+ let result_buffer = JsBuffer::from_slice(&mut cx, signed_bytes.as_slice())?;
335
+
336
+ if let Some(signed_asset) = signed_asset {
337
+ let signed_buffer = JsBuffer::from_slice(&mut cx, &signed_asset)?;
338
+ let result = cx.empty_object();
339
+ result.set(&mut cx, "manifest", result_buffer)?;
340
+ result.set(&mut cx, "signedAsset", signed_buffer)?;
341
+ Ok(result.upcast::<JsValue>())
342
+ } else {
343
+ Ok(result_buffer.upcast::<JsValue>())
344
+ }
345
+ }
346
+ Err(err) => cx.throw_error(err.to_string()),
347
+ });
348
+ });
349
+ Ok(promise)
350
+ }
351
+
352
+ pub fn sign_async(mut cx: FunctionContext) -> JsResult<JsPromise> {
353
+ let rt = runtime();
354
+ let channel = cx.channel();
355
+
356
+ let this = cx.this::<JsBox<Self>>()?;
357
+ let signer = cx.argument::<JsBox<NeonCallbackSigner>>(0)?;
358
+ let signer_ref: &NeonCallbackSigner = signer.deref();
359
+ let signer = signer_ref.clone();
360
+ let input = cx
361
+ .argument::<JsObject>(1)
362
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
363
+ let output_obj = cx.argument::<JsObject>(2)?;
364
+ let output = parse_asset(&mut cx, output_obj)?;
365
+ let format = match input.mime_type() {
366
+ Some(mime_type) => mime_type.to_owned(),
367
+ None => return cx.throw_error("Input asset must have a mime type"),
368
+ };
369
+ let mut input_stream = input
370
+ .into_read_stream()
371
+ .or_else(|err| cx.throw_error(err.to_string()))?;
372
+ let mut output_stream = output
373
+ .write_stream()
374
+ .or_else(|err| cx.throw_error(err.to_string()))?;
375
+
376
+ let builder = Arc::clone(&this.builder);
377
+ let (deferred, promise) = cx.promise();
378
+ rt.spawn(async move {
379
+ let result = builder
380
+ .lock()
381
+ .await
382
+ .sign_async(&signer, &format, &mut input_stream, &mut output_stream)
383
+ .await
384
+ .map(|sign_result| (sign_result, output_stream));
385
+
386
+ deferred.settle_with(&channel, move |mut cx| match result {
387
+ Ok((signed_bytes, mut output_stream)) => {
388
+ let signed_asset = if output.name() == "destination_buffer" {
389
+ let mut buffer = Vec::new();
390
+ match output_stream.rewind() {
391
+ Ok(_) => (),
392
+ Err(e) => {
393
+ return cx.throw_error(format!("Failed to rewind stream: {e}"))
394
+ }
395
+ }
396
+ match output_stream.read_to_end(&mut buffer) {
397
+ Ok(_) => (),
398
+ Err(e) => return cx.throw_error(format!("Failed to read stream: {e}")),
399
+ }
400
+ Some(buffer)
401
+ } else {
402
+ None
403
+ };
404
+
405
+ let result_buffer = JsBuffer::from_slice(&mut cx, signed_bytes.as_slice())?;
406
+
407
+ if let Some(signed_asset) = signed_asset {
408
+ let signed_buffer = JsBuffer::from_slice(&mut cx, &signed_asset)?;
409
+ let result = cx.empty_object();
410
+ result.set(&mut cx, "manifest", result_buffer)?;
411
+ result.set(&mut cx, "signedAsset", signed_buffer)?;
412
+ Ok(result.upcast::<JsValue>())
413
+ } else {
414
+ Ok(result_buffer.upcast::<JsValue>())
415
+ }
416
+ }
417
+ Err(err) => cx.throw_error(err.to_string()),
418
+ });
419
+ });
420
+ Ok(promise)
421
+ }
422
+
423
+ pub fn identity_sign_async(mut cx: FunctionContext) -> JsResult<JsPromise> {
424
+ let rt = runtime();
425
+ let channel = cx.channel();
426
+
427
+ let this = cx.this::<JsBox<Self>>()?;
428
+ let signer = cx.argument::<JsBox<NeonIdentityAssertionSigner>>(0)?;
429
+ let signer_ref: &NeonIdentityAssertionSigner = signer.deref();
430
+ let signer = signer_ref.clone();
431
+ let input = cx
432
+ .argument::<JsObject>(1)
433
+ .and_then(|obj| parse_asset(&mut cx, obj))?;
434
+ let output_obj = cx.argument::<JsObject>(2)?;
435
+ let output = parse_asset(&mut cx, output_obj)?;
436
+ let format = match input.mime_type() {
437
+ Some(mime_type) => mime_type.to_owned(),
438
+ None => return cx.throw_error("Input asset must have a mime type"),
439
+ };
440
+ let mut input_stream = input
441
+ .into_read_stream()
442
+ .or_else(|err| cx.throw_error(err.to_string()))?;
443
+ let mut output_stream = output
444
+ .write_stream()
445
+ .or_else(|err| cx.throw_error(err.to_string()))?;
446
+
447
+ let builder = Arc::clone(&this.builder);
448
+ let (deferred, promise) = cx.promise();
449
+
450
+ rt.spawn(async move {
451
+ let result = builder
452
+ .lock()
453
+ .await
454
+ .sign_async(&signer, &format, &mut input_stream, &mut output_stream)
455
+ .await
456
+ .map(|sign_result| (sign_result, output_stream));
457
+
458
+ deferred.settle_with(&channel, move |mut cx| match result {
459
+ Ok((signed_bytes, mut output_stream)) => {
460
+ let signed_asset = if output.name() == "destination_buffer" {
461
+ let mut buffer = Vec::new();
462
+ match output_stream.rewind() {
463
+ Ok(_) => (),
464
+ Err(e) => {
465
+ return cx.throw_error(format!("Failed to rewind stream: {e}"))
466
+ }
467
+ }
468
+ match output_stream.read_to_end(&mut buffer) {
469
+ Ok(_) => (),
470
+ Err(e) => return cx.throw_error(format!("Failed to read stream: {e}")),
471
+ }
472
+ Some(buffer)
473
+ } else {
474
+ None
475
+ };
476
+
477
+ let result_buffer = JsBuffer::from_slice(&mut cx, signed_bytes.as_slice())?;
478
+
479
+ if let Some(signed_asset) = signed_asset {
480
+ let signed_buffer = JsBuffer::from_slice(&mut cx, &signed_asset)?;
481
+ let result = cx.empty_object();
482
+ result.set(&mut cx, "manifest", result_buffer)?;
483
+ result.set(&mut cx, "signedAsset", signed_buffer)?;
484
+ Ok(result.upcast::<JsValue>())
485
+ } else {
486
+ Ok(result_buffer.upcast::<JsValue>())
487
+ }
488
+ }
489
+ Err(err) => cx.throw_error(err.to_string()),
490
+ });
491
+ });
492
+ Ok(promise)
493
+ }
494
+
495
+ pub fn manifest_definition(mut cx: FunctionContext) -> JsResult<JsValue> {
496
+ let rt = runtime();
497
+ let this = cx.this::<JsBox<Self>>()?;
498
+ let builder = rt.block_on(async { this.builder.lock().await });
499
+ let json = serde_json::to_string(&builder.definition)
500
+ .or_else(|err| cx.throw_error(err.to_string()))?;
501
+ Ok(cx.string(json).upcast())
502
+ }
503
+
504
+ /// Update a manifest property. Available properties are limited to strings and numbers.
505
+ /// There are other methods for thumbnails, ingredients and assertions, etc.
506
+ pub fn update_manifest_property(mut cx: FunctionContext) -> JsResult<JsUndefined> {
507
+ let rt = runtime();
508
+ let this = cx.this::<JsBox<Self>>()?;
509
+ let property = cx.argument::<JsString>(0)?.value(&mut cx);
510
+ let value = cx.argument::<JsValue>(1)?;
511
+
512
+ let mut builder = rt.block_on(async { this.builder.lock().await });
513
+
514
+ match property.as_str() {
515
+ "vendor" => {
516
+ let value = value
517
+ .downcast_or_throw::<JsString, _>(&mut cx)?
518
+ .value(&mut cx);
519
+ builder.definition.vendor = Some(value);
520
+ }
521
+ "title" => {
522
+ let value = value
523
+ .downcast_or_throw::<JsString, _>(&mut cx)?
524
+ .value(&mut cx);
525
+ builder.definition.title = Some(value);
526
+ }
527
+ "format" => {
528
+ let value = value
529
+ .downcast_or_throw::<JsString, _>(&mut cx)?
530
+ .value(&mut cx);
531
+ builder.definition.format = value;
532
+ }
533
+ "instance_id" => {
534
+ let value = value
535
+ .downcast_or_throw::<JsString, _>(&mut cx)?
536
+ .value(&mut cx);
537
+ builder.definition.instance_id = value;
538
+ }
539
+ "label" => {
540
+ let value = value
541
+ .downcast_or_throw::<JsString, _>(&mut cx)?
542
+ .value(&mut cx);
543
+ builder.definition.label = Some(value);
544
+ }
545
+ "claim_version" => {
546
+ let value = value
547
+ .downcast_or_throw::<JsNumber, _>(&mut cx)?
548
+ .value(&mut cx) as u8;
549
+ builder.definition.claim_version = Some(value);
550
+ }
551
+ _ => {
552
+ return cx.throw_error(format!(
553
+ "Property '{property}' not found or not a valid type"
554
+ ))
555
+ }
556
+ }
557
+
558
+ Ok(cx.undefined())
559
+ }
560
+ }
561
+
562
+ impl Finalize for NeonBuilder {}