1pub mod columns;
7pub mod concerns;
8pub mod config;
9mod console;
10pub mod coordinate;
11mod error;
12pub mod events;
13mod excel;
14mod export;
15mod fake;
16mod html;
17mod html_writer;
18mod import;
19mod number_formatter;
20mod other_readers;
21mod provider;
22mod queue;
23mod reader;
24mod rich_text;
25mod row;
26pub mod sheets;
27pub mod spreadsheet;
28pub mod style;
29mod value;
30mod writer;
31mod xlsx_extras;
32
33pub use config::{CsvExportSettings, CsvImportSettings, ExcelConfig};
34pub use error::{ExcelError, Failure, ValidationException};
35pub use excel::{
36 AsDynExport, AsDynImport, Excel, Exportable, ImportFile, Importable, PendingDownload, PendingImport, PendingQueue,
37 PendingQueueImport, PendingRows, PendingStore, Queued, Type,
38};
39pub use export::{Export, SheetWriter};
40pub use fake::ExcelFake;
41pub use import::{HeadingRowFormatter, Import, SheetImport, SheetRows, slug};
42pub use provider::{Errors, ExcelServiceProvider, Failures, HeadingRowImport};
43pub use queue::{QueuedExportJob, QueuedImportJob};
44pub use row::{IntoRows, Key, Row};
45pub use sheets::{SheetKey, Sheets};
46pub use spreadsheet::{Chart, ChartSeries, ChartType, Comment, Drawing, Hyperlink, Spreadsheet, TextRun, Worksheet};
47pub use style::{Style, number_format};
48pub use value::{
49 AdvancedValueBinder, DefaultValueBinder, StringValueBinder, Value, ValueBinder, date_time_to_excel,
50 excel_to_date_time,
51};
52pub use xlsx_extras::ImageContent;
53
54#[doc(hidden)]
56pub mod __private {
57 use std::any::Any;
58 use std::sync::Arc;
59
60 pub use futures_util::future::BoxFuture;
61 pub use inventory;
62 pub use laravel::Result;
63 pub use serde_json;
64
65 #[cfg(feature = "scout")]
66 pub use crate::export::write_scout;
67 pub use crate::export::{
68 ExportConcerns, SheetWriter, Source, count_query, write_array, write_collection, write_generator,
69 write_iterator, write_query,
70 };
71 pub use crate::import::{
72 ImportConcerns, SheetImport, handle_array, handle_collection, handle_each_row, handle_models,
73 };
74 pub use crate::queue::{QueueableExport, QueueableImport};
75 pub use crate::row::into_single_row;
76 pub use crate::sheets::Sheet;
77
78 pub struct Snapshot<'a, T>(pub &'a T);
81
82 pub trait SnapshotClone {
83 fn __snapshot(&self) -> Option<Arc<dyn Any + Send + Sync>>;
84 }
85
86 impl<T: Clone + Any + Send + Sync> SnapshotClone for Snapshot<'_, T> {
87 fn __snapshot(&self) -> Option<Arc<dyn Any + Send + Sync>> {
88 Some(Arc::new(self.0.clone()))
89 }
90 }
91
92 pub trait SnapshotNone {
93 fn __snapshot(&self) -> Option<Arc<dyn Any + Send + Sync>>;
94 }
95
96 impl<T> SnapshotNone for &Snapshot<'_, T> {
97 fn __snapshot(&self) -> Option<Arc<dyn Any + Send + Sync>> {
98 None
99 }
100 }
101}
102
103#[doc(hidden)]
105#[macro_export]
106macro_rules! __if_has {
107 (ToModel; [ToModel $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
108 (ToCollection; [ToCollection $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
109 (ToArray; [ToArray $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
110 (OnEachRow; [OnEachRow $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
111 (WithMapping; [WithMapping $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
112 (WithCustomQuerySize; [WithCustomQuerySize $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
113 (ShouldQueue; [ShouldQueue $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
114 (ShouldQueue; [Queueable $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
115 (ShouldQueue; [ShouldQueueWithoutChain $(, $rest:ident)*] => { $($code:tt)* }) => { $($code)* };
116 ($name:ident; [$other:ident $(, $rest:ident)*] => { $($code:tt)* }) => {
117 $crate::__if_has! { $name; [$($rest),*] => { $($code)* } }
118 };
119 ($name:ident; [] => { $($code:tt)* }) => {};
120}
121
122#[doc(hidden)]
124#[macro_export]
125macro_rules! __if_has_else {
126 (WithMapping; [WithMapping $(, $rest:ident)*] => { $($yes:tt)* } else { $($no:tt)* }) => { $($yes)* };
127 (WithCustomQuerySize; [WithCustomQuerySize $(, $rest:ident)*] => { $($yes:tt)* } else { $($no:tt)* }) => { $($yes)* };
128 ($name:ident; [$other:ident $(, $rest:ident)*] => { $($yes:tt)* } else { $($no:tt)* }) => {
129 $crate::__if_has_else!($name; [$($rest),*] => { $($yes)* } else { $($no)* })
130 };
131 ($name:ident; [] => { $($yes:tt)* } else { $($no:tt)* }) => { $($no)* };
132}
133
134#[doc(hidden)]
135#[macro_export]
136macro_rules! __export_concern {
137 ($s:tt, $c:ident, FromCollection) => {
138 $c.source = $crate::__private::Source::Collection;
139 };
140 ($s:tt, $c:ident, FromArray) => {
141 $c.source = $crate::__private::Source::Array;
142 };
143 ($s:tt, $c:ident, FromIterator) => {
144 $c.source = $crate::__private::Source::Iterator;
145 };
146 ($s:tt, $c:ident, FromGenerator) => {
147 $c.source = $crate::__private::Source::Generator;
148 };
149 ($s:tt, $c:ident, FromQuery) => {
150 $c.source = $crate::__private::Source::Query;
151 };
152 ($s:tt, $c:ident, FromScout) => {
153 $c.source = $crate::__private::Source::Scout;
154 };
155 ($s:tt, $c:ident, FromView) => {
156 $c.view = Some($s);
157 };
158 ($s:tt, $c:ident, WithHeadings) => {
159 $c.headings = Some(::std::boxed::Box::new(move || {
160 $crate::IntoRows::into_rows($crate::concerns::WithHeadings::headings($s))
161 }));
162 };
163 ($s:tt, $c:ident, WithMapping) => {
164 $c.mapping = true;
165 };
166 ($s:tt, $c:ident, WithColumns) => {
167 $c.columns = Some($s);
168 };
169 ($s:tt, $c:ident, WithCharts) => {
170 $c.charts = Some($s);
171 };
172 ($s:tt, $c:ident, WithExportTemplate) => {
173 $c.template = Some($s);
174 };
175 ($s:tt, $c:ident, WithColumnFormatting) => {
176 $c.column_formatting = Some($s);
177 };
178 ($s:tt, $c:ident, ShouldAutoSize) => {
179 let _: &dyn $crate::concerns::ShouldAutoSize = $s;
180 $c.should_auto_size = true;
181 };
182 ($s:tt, $c:ident, WithTitle) => {
183 $c.title = Some($s);
184 };
185 ($s:tt, $c:ident, WithMultipleSheets) => {
186 $c.multiple_sheets = Some($s);
187 };
188 ($s:tt, $c:ident, WithConditionalSheets) => {
189 $c.multiple_sheets = Some($s);
190 };
191 ($s:tt, $c:ident, WithStyles) => {
192 $c.styles = Some($s);
193 };
194 ($s:tt, $c:ident, WithEvents) => {
195 $c.events = Some($s);
196 };
197 ($s:tt, $c:ident, WithCustomStartCell) => {
198 $c.start_cell = Some($s);
199 };
200 ($s:tt, $c:ident, WithStrictNullComparison) => {
201 let _: &dyn $crate::concerns::WithStrictNullComparison = $s;
202 $c.strict_null_comparison = true;
203 };
204 ($s:tt, $c:ident, HasReferencesToOtherSheets) => {
205 let _: &dyn $crate::concerns::HasReferencesToOtherSheets = $s;
206 };
207 ($s:tt, $c:ident, WithProperties) => {
208 $c.properties = Some($s);
209 };
210 ($s:tt, $c:ident, WithColumnWidths) => {
211 $c.column_widths = Some($s);
212 };
213 ($s:tt, $c:ident, WithFreezePane) => {
214 $c.freeze_pane = Some($s);
215 };
216 ($s:tt, $c:ident, WithTabColor) => {
217 $c.tab_color = Some($s);
218 };
219 ($s:tt, $c:ident, WithSheetProtection) => {
220 $c.sheet_protection = Some($s);
221 };
222 ($s:tt, $c:ident, WithPageBreaks) => {
223 $c.page_breaks = Some($s);
224 };
225 ($s:tt, $c:ident, WithPrintArea) => {
226 $c.print_area = Some($s);
227 };
228 ($s:tt, $c:ident, WithDrawings) => {
229 $c.drawings = Some($s);
230 };
231 ($s:tt, $c:ident, WithDefaultStyles) => {
232 $c.default_styles = Some($s);
233 };
234 ($s:tt, $c:ident, WithBackgroundColor) => {
235 $c.background_color = Some($s);
236 };
237 ($s:tt, $c:ident, WithCustomValueBinder) => {
238 let _: &dyn $crate::concerns::WithCustomValueBinder = $s;
239 $c.value_binder = Some($s);
240 };
241 ($s:tt, $c:ident, WithCustomCsvSettings) => {
242 $c.csv_settings = Some($s);
243 };
244 ($s:tt, $c:ident, WithCustomChunkSize) => {
245 $c.chunk_size = Some($s);
246 };
247 ($s:tt, $c:ident, WithCustomQuerySize) => {};
248 ($s:tt, $c:ident, WithPreCalculateFormulas) => {
249 let _: &dyn $crate::concerns::WithPreCalculateFormulas = $s;
250 $c.pre_calculate_formulas = true;
251 };
252 ($s:tt, $c:ident, ShouldQueue) => {
253 $c.should_queue = Some($s);
254 };
255 ($s:tt, $c:ident, ShouldBatch) => {
256 let _: &dyn $crate::concerns::ShouldBatch = $s;
257 $c.should_batch = true;
258 };
259 ($s:tt, $c:ident, Queueable) => {};
260 ($s:tt, $c:ident, $other:ident) => {
261 ::core::compile_error!(::core::concat!(
262 "`",
263 ::core::stringify!($other),
264 "` isn't an export concern laravel-excel supports"
265 ));
266 };
267}
268
269#[doc(hidden)]
270#[macro_export]
271macro_rules! __export_source {
272 ($s:tt, $sheet:ident, $window:ident, [FromCollection $(, $rest:ident)*], $all:tt) => {
273 $crate::__private::write_collection($s, $sheet, $crate::__export_mapper!($s, $all)).await
274 };
275 ($s:tt, $sheet:ident, $window:ident, [FromArray $(, $rest:ident)*], $all:tt) => {
276 $crate::__private::write_array($s, $sheet, $crate::__export_mapper!($s, $all)).await
277 };
278 ($s:tt, $sheet:ident, $window:ident, [FromIterator $(, $rest:ident)*], $all:tt) => {
279 $crate::__private::write_iterator($s, $sheet, $crate::__export_mapper!($s, $all)).await
280 };
281 ($s:tt, $sheet:ident, $window:ident, [FromGenerator $(, $rest:ident)*], $all:tt) => {
282 $crate::__private::write_generator($s, $sheet, $crate::__export_mapper!($s, $all)).await
283 };
284 ($s:tt, $sheet:ident, $window:ident, [FromQuery $(, $rest:ident)*], $all:tt) => {
285 $crate::__private::write_query($s, $sheet, $window, $crate::__export_mapper!($s, $all)).await
286 };
287 ($s:tt, $sheet:ident, $window:ident, [FromScout $(, $rest:ident)*], $all:tt) => {
288 $crate::__private::write_scout($s, $sheet, $crate::__export_mapper!($s, $all)).await
289 };
290 ($s:tt, $sheet:ident, $window:ident, [$other:ident $(, $rest:ident)*], $all:tt) => {
291 $crate::__export_source!($s, $sheet, $window, [$($rest),*], $all)
292 };
293 ($s:tt, $sheet:ident, $window:ident, [], $all:tt) => {
294 ::core::result::Result::Ok(())
295 };
296}
297
298#[doc(hidden)]
299#[macro_export]
300macro_rules! __export_mapper {
301 ($s:tt, [$($all:ident),*]) => {
302 $crate::__if_has_else!(WithMapping; [$($all),*] => {
303 |row| $crate::concerns::WithMapping::map($s, row)
304 } else {
305 |row| row
306 })
307 };
308}
309
310#[doc(hidden)]
311#[macro_export]
312macro_rules! __export_count {
313 ($s:tt, [FromQuery $(, $rest:ident)*], [$($all:ident),*]) => {
314 $crate::__if_has_else!(WithCustomQuerySize; [$($all),*] => {
315 ::core::result::Result::Ok(::core::option::Option::Some(
316 $crate::concerns::WithCustomQuerySize::query_size($s).await?,
317 ))
318 } else {
319 ::core::result::Result::Ok(::core::option::Option::Some($crate::__private::count_query($s).await?))
320 })
321 };
322 ($s:tt, [$other:ident $(, $rest:ident)*], $all:tt) => {
323 $crate::__export_count!($s, [$($rest),*], $all)
324 };
325 ($s:tt, [], $all:tt) => {
326 ::core::result::Result::Ok(::core::option::Option::None)
327 };
328}
329
330#[doc(hidden)]
331#[macro_export]
332macro_rules! __snapshot_and_name {
333 ($ty:ty) => {
334 fn __type_name(&self) -> &'static str {
335 ::core::any::type_name::<$ty>()
336 }
337
338 fn __snapshot(
339 &self,
340 ) -> ::core::option::Option<::std::sync::Arc<dyn ::core::any::Any + ::core::marker::Send + ::core::marker::Sync>> {
341 #[allow(unused_imports)]
342 use $crate::__private::{SnapshotClone as _, SnapshotNone as _};
343 (&$crate::__private::Snapshot(self)).__snapshot()
344 }
345 };
346}
347
348#[doc(hidden)]
349#[macro_export]
350macro_rules! __queue_payload {
351 ($ty:ty; $all:tt) => {
352 $crate::__if_has! { ShouldQueue; $all => {
353 fn __queue_payload(
354 &self,
355 ) -> ::core::option::Option<$crate::__private::Result<(&'static str, $crate::__private::serde_json::Value)>> {
356 ::core::option::Option::Some(
357 $crate::__private::serde_json::to_value(self)
358 .map(|value| (::core::concat!(::core::module_path!(), "::", ::core::stringify!($ty)), value))
359 .map_err(::core::convert::Into::into),
360 )
361 }
362 } }
363 };
364}
365
366#[macro_export]
378macro_rules! export {
379 ($ty:ty : $($concern:ident),* $(,)?) => {
380 impl $crate::Export for $ty {
381 fn __concerns(&self) -> $crate::__private::ExportConcerns<'_> {
382 #[allow(unused_mut)]
383 let mut concerns = $crate::__private::ExportConcerns::default();
384 $( $crate::__export_concern!(self, concerns, $concern); )*
385 concerns
386 }
387
388 fn __write<'a>(
389 &'a self,
390 sheet: &'a mut $crate::__private::SheetWriter<'_>,
391 window: ::core::option::Option<(u64, u64)>,
392 ) -> $crate::__private::BoxFuture<'a, $crate::__private::Result<()>> {
393 ::std::boxed::Box::pin(async move {
394 let _ = (&sheet, &window);
395 $crate::__export_source!(self, sheet, window, [$($concern),*], [$($concern),*])
396 })
397 }
398
399 fn __count(&self) -> $crate::__private::BoxFuture<'_, $crate::__private::Result<::core::option::Option<u64>>> {
400 ::std::boxed::Box::pin(async move {
401 $crate::__export_count!(self, [$($concern),*], [$($concern),*])
402 })
403 }
404
405 $crate::__snapshot_and_name!($ty);
406
407 $crate::__queue_payload!($ty; [$($concern),*]);
408 }
409
410 impl $crate::sheets::IntoSheet for $ty {
411 fn into_sheet(self) -> $crate::__private::Sheet {
412 $crate::__private::Sheet::Export(::std::boxed::Box::new(self))
413 }
414 }
415
416 $crate::__if_has! { ShouldQueue; [$($concern),*] => {
417 $crate::__private::inventory::submit! {
418 $crate::__private::QueueableExport {
419 name: ::core::concat!(::core::module_path!(), "::", ::core::stringify!($ty)),
420 restore: {
421 fn restore(
422 value: $crate::__private::serde_json::Value,
423 ) -> $crate::__private::Result<::std::boxed::Box<dyn $crate::Export>> {
424 ::core::result::Result::Ok(::std::boxed::Box::new(
425 $crate::__private::serde_json::from_value::<$ty>(value)?,
426 ))
427 }
428 restore
429 },
430 }
431 }
432 } }
433 };
434}
435
436#[doc(hidden)]
437#[macro_export]
438macro_rules! __import_concern {
439 ($s:tt, $c:ident, ToModel) => {};
440 ($s:tt, $c:ident, ToCollection) => {};
441 ($s:tt, $c:ident, ToArray) => {};
442 ($s:tt, $c:ident, OnEachRow) => {};
443 ($s:tt, $c:ident, WithHeadingRow) => {
444 $c.heading_row = Some($s);
445 };
446 ($s:tt, $c:ident, WithGroupedHeadingRow) => {
447 let _: &dyn $crate::concerns::WithGroupedHeadingRow = $s;
448 $c.heading_row = Some($s);
449 $c.grouped_heading_row = true;
450 };
451 ($s:tt, $c:ident, WithStartRow) => {
452 $c.start_row = Some($s);
453 };
454 ($s:tt, $c:ident, WithLimit) => {
455 $c.limit = Some($s);
456 };
457 ($s:tt, $c:ident, WithColumnLimit) => {
458 $c.column_limit = Some($s);
459 };
460 ($s:tt, $c:ident, WithMappedCells) => {
461 $c.mapped_cells = Some($s);
462 };
463 ($s:tt, $c:ident, WithMapping) => {
464 $c.mapping = Some(::std::boxed::Box::new(move |row: $crate::Row| {
465 $crate::__private::into_single_row(<Self as $crate::concerns::WithMapping<$crate::Row>>::map($s, row))
466 }));
467 };
468 ($s:tt, $c:ident, WithValidation) => {
469 $c.validation = Some($s);
470 };
471 ($s:tt, $c:ident, SkipsOnFailure) => {
472 $c.skips_on_failure = Some($s);
473 };
474 ($s:tt, $c:ident, SkipsOnError) => {
475 $c.skips_on_error = Some($s);
476 };
477 ($s:tt, $c:ident, SkipsEmptyRows) => {
478 $c.skips_empty_rows = Some($s);
479 };
480 ($s:tt, $c:ident, SkipsUnknownSheets) => {
481 $c.skips_unknown_sheets = Some($s);
482 };
483 ($s:tt, $c:ident, WithCalculatedFormulas) => {
484 let _: &dyn $crate::concerns::WithCalculatedFormulas = $s;
485 $c.calculated_formulas = true;
486 };
487 ($s:tt, $c:ident, WithColumns) => {
488 $c.columns = Some($s);
489 };
490 ($s:tt, $c:ident, WithFormatData) => {
491 let _: &dyn $crate::concerns::WithFormatData = $s;
492 $c.format_data = true;
493 };
494 ($s:tt, $c:ident, WithSkipDuplicates) => {
495 let _: &dyn $crate::concerns::WithSkipDuplicates = $s;
496 $c.skip_duplicates = true;
497 };
498 ($s:tt, $c:ident, WithReadFilter) => {
499 $c.read_filter = Some($s);
500 };
501 ($s:tt, $c:ident, WithProgressBar) => {
502 $c.progress_bar = Some($s);
503 };
504 ($s:tt, $c:ident, WithStrictNullComparison) => {
505 let _: &dyn $crate::concerns::WithStrictNullComparison = $s;
506 $c.strict_null_comparison = true;
507 };
508 ($s:tt, $c:ident, WithEvents) => {
509 $c.events = Some($s);
510 };
511 ($s:tt, $c:ident, WithCustomCsvSettings) => {
512 $c.csv_settings = Some($s);
513 };
514 ($s:tt, $c:ident, WithCustomValueBinder) => {
515 let _: &dyn $crate::concerns::WithCustomValueBinder = $s;
516 $c.value_binder = Some($s);
517 };
518 ($s:tt, $c:ident, WithMultipleSheets) => {
519 $c.multiple_sheets = Some($s);
520 };
521 ($s:tt, $c:ident, WithConditionalSheets) => {
522 $c.multiple_sheets = Some($s);
523 };
524 ($s:tt, $c:ident, WithBatchInserts) => {
525 $c.batch_inserts = Some($s);
526 };
527 ($s:tt, $c:ident, WithChunkReading) => {
528 $c.chunk_reading = Some($s);
529 };
530 ($s:tt, $c:ident, WithUpserts) => {
531 $c.upserts = Some($s);
532 };
533 ($s:tt, $c:ident, WithUpsertColumns) => {
534 $c.upsert_columns = Some($s);
535 };
536 ($s:tt, $c:ident, ShouldQueue) => {
537 $c.should_queue = Some($s);
538 };
539 ($s:tt, $c:ident, ShouldBatch) => {
540 let _: &dyn $crate::concerns::ShouldBatch = $s;
541 $c.should_batch = true;
542 };
543 ($s:tt, $c:ident, ShouldQueueWithoutChain) => {
544 $c.should_queue = Some($s);
545 $c.without_chain = Some($s);
546 };
547 ($s:tt, $c:ident, RemembersRowNumber) => {
548 let _: &dyn $crate::concerns::RemembersRowNumber = $s;
549 };
550 ($s:tt, $c:ident, RemembersChunkOffset) => {
551 let _: &dyn $crate::concerns::RemembersChunkOffset = $s;
552 };
553 ($s:tt, $c:ident, Queueable) => {};
554 ($s:tt, $c:ident, $other:ident) => {
555 ::core::compile_error!(::core::concat!(
556 "`",
557 ::core::stringify!($other),
558 "` isn't an import concern laravel-excel supports"
559 ));
560 };
561}
562
563#[macro_export]
573macro_rules! import {
574 ($ty:ty : $($concern:ident),* $(,)?) => {
575 impl $crate::Import for $ty {
576 fn __concerns(&self) -> $crate::__private::ImportConcerns<'_> {
577 #[allow(unused_mut)]
578 let mut concerns = $crate::__private::ImportConcerns::default();
579 $( $crate::__import_concern!(self, concerns, $concern); )*
580 concerns
581 }
582
583 fn __handle<'a>(
584 &'a self,
585 sheet: &'a $crate::__private::SheetImport<'a>,
586 ) -> $crate::__private::BoxFuture<'a, $crate::__private::Result<()>> {
587 ::std::boxed::Box::pin(async move {
588 let _ = &sheet;
589 $crate::__if_has!(ToModel; [$($concern),*] => {
590 $crate::__private::handle_models(self, sheet).await?;
591 });
592 $crate::__if_has!(ToCollection; [$($concern),*] => {
593 $crate::__private::handle_collection(self, sheet).await?;
594 });
595 $crate::__if_has!(ToArray; [$($concern),*] => {
596 $crate::__private::handle_array(self, sheet).await?;
597 });
598 $crate::__if_has!(OnEachRow; [$($concern),*] => {
599 $crate::__private::handle_each_row(self, sheet).await?;
600 });
601 ::core::result::Result::Ok(())
602 })
603 }
604
605 $crate::__snapshot_and_name!($ty);
606
607 $crate::__queue_payload!($ty; [$($concern),*]);
608 }
609
610 impl $crate::sheets::IntoSheet for $ty {
611 fn into_sheet(self) -> $crate::__private::Sheet {
612 $crate::__private::Sheet::Import(::std::boxed::Box::new(self))
613 }
614 }
615
616 $crate::__if_has! { ShouldQueue; [$($concern),*] => {
617 $crate::__private::inventory::submit! {
618 $crate::__private::QueueableImport {
619 name: ::core::concat!(::core::module_path!(), "::", ::core::stringify!($ty)),
620 restore: {
621 fn restore(
622 value: $crate::__private::serde_json::Value,
623 ) -> $crate::__private::Result<::std::boxed::Box<dyn $crate::Import>> {
624 ::core::result::Result::Ok(::std::boxed::Box::new(
625 $crate::__private::serde_json::from_value::<$ty>(value)?,
626 ))
627 }
628 restore
629 },
630 }
631 }
632 } }
633 };
634}