shori 0.1.2

Flexible parsing and transformation utilities for structured data. #[derive(Parser)] adds methods like .parse().json(), .toml(), .bin(), .map(), and .from() to simplify conversions using common wrappers like Arc, Mutex, Box, OnceCell, etc.
Documentation
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
# `shori`

[![Crates.io](https://img.shields.io/crates/v/shori.svg)](https://crates.io/crates/shori)
[![Docs.rs](https://docs.rs/shori/badge.svg)](https://docs.rs/shori)
[![License](https://img.shields.io/crates/l/shori.svg)](https://github.com/pas2rust/shori/blob/main/LICENSE)
![GitHub top language](https://img.shields.io/github/languages/top/pas2rust/shori?color=orange&logo=rust&style=flat&logoColor=white)
![GitHub stars](https://img.shields.io/github/stars/pas2rust/shori?color=success&style=flat&logo=github)
![GitHub forks](https://img.shields.io/github/forks/pas2rust/shori?color=orange&logo=Furry%20Network&style=flat&logoColor=white)
![Tests](https://raw.githubusercontent.com/pas2rust/badges/main/shori-tests.svg)
![Crates.io downloads](https://img.shields.io/crates/d/shori.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/pas2rust/shori?color=ff69b4&label=update&logo=git&style=flat&logoColor=white)


**`shori`** is a flexible data transformation and parsing toolkit for Rust.  
It provides the `#[derive(Parser)]` macro, which automatically implements conversions for your structs—supporting formats like JSON, TOML, bincode, and common smart pointers and containers like `Arc`, `Mutex`, and `Box`.

Designed for ergonomic and type-safe data manipulation.

---

## 🔧 Features

### ✨ Auto-Derived Parsing & Conversions

- `#[derive(Parser)]` implements:
  - `.parse().json()`
  - `.toml()`
  - `.bin()`
  - `.map()`
  - `.from()`, `.from_value()`
- Supports conversion from and to:
  - `String`, `Vec<u8>`, `serde_json::Value`, `toml::Value`, `HashMap<String, Value>`
  - Wrappers: `Box`, `Arc`, `Mutex`, `RefCell`, `OnceCell`, `UnsafeCell`, `tokio::sync::Mutex`, `Vec<T>`

---

## 📦 Installation

```bash
cargo add shori
```

## 🚀 Usage
Basic Example

```rust
#![cfg(feature = "full")]

use kenzu::Builder;
use serde::{Deserialize, Serialize};
use shori::Parser;

#[derive(
    Builder,
    PartialEq,
    Parser,
    Debug,
    Clone,
    Serialize,
    Deserialize,
    bincode::Encode,
    bincode::Decode,
)]
pub struct User {
    pub id: String,
    #[opt(default = "name")]
    pub name: String,
    pub password: String,
    #[opt(
        pattern = r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$",
        err = "err",
        default = "email@example.com"
    )]
    pub email: String,
    #[opt(default = 18)]
    pub age: u8,
    pub gender: String,
}

#[test]
fn parse_bin() -> Result<(), String> {
    let user_parse_bin = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .bin()
        .unwrap();

    let user_bin = user_parse_bin.get();
    let user_bin_from_bytes = user_parse_bin.from_bytes(user_bin);
    assert!(user_bin_from_bytes.is_ok());

    let user_hex = user_parse_bin.hex();
    let user_from_hex = user_parse_bin.from_hex(&user_hex);

    assert!(user_from_hex.is_ok());
    let user = user_from_hex.unwrap();

    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    let user = user_bin_from_bytes.unwrap();
    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    let user_from = user_parse_bin.from();
    assert!(user_from.is_ok());

    let user = user_from.unwrap();
    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[test]
fn parse_arc_mutex_concurrent() -> Result<(), String> {
    use std::sync::Arc;
    use std::thread;

    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .mutex()
        .arc();

    let user_clone = Arc::clone(&user);
    let handle = thread::spawn(move || {
        let mut locked_user = user_clone.lock().unwrap();
        locked_user.name = "Jane Doe".into();
    });

    handle.join().unwrap();

    assert_eq!(user.lock().unwrap().name, "Jane Doe");

    Ok(())
}

#[test]
fn parse_arc_mutex() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .mutex()
        .arc();

    let locked_user = user.lock().unwrap();

    assert_eq!(locked_user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(locked_user.name, "John Doe");
    assert_eq!(locked_user.password, "password123");
    assert_eq!(locked_user.email, "johndoe@example.com");
    assert_eq!(locked_user.age, 25);
    assert_eq!(locked_user.gender, "F");

    Ok(())
}

#[test]
fn parse_arc() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .arc()
        .get();

    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.password, "password123");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[test]
fn parse_box() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .boxed()
        .get();

    assert_eq!(user.name, "John Doe");

    Ok(())
}

#[test]
fn parse_hash_map() -> Result<(), String> {
    let id = "123e4567-e89b-12d3-a456-426614174000";
    let name = "John Doe";
    let password = "password123";
    let email = "johndoe@example.com";
    let age = 25;
    let gender = "F";

    let user = User::new()
        .id(UserId::new(id)?)
        .name(UserName::new(name)?)
        .password(UserPassword::new(password)?)
        .email(UserEmail::new(email)?)
        .age(UserAge::new(age)?)
        .gender(UserGender::new(gender)?)
        .parse()
        .hashmap();

    assert_eq!(user.get::<String>("id").unwrap(), &id);
    assert_eq!(user.get::<String>("name").unwrap(), &name);
    assert_eq!(user.get::<String>("password").unwrap(), &password);
    assert_eq!(user.get::<String>("email").unwrap(), &email);
    assert_eq!(user.get::<u8>("age").unwrap(), &age);
    assert_eq!(user.get::<String>("gender").unwrap(), &gender);

    Ok(())
}

#[test]
fn parse_json() -> Result<(), String> {
    let user_parse_json = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .json()
        .unwrap();

    let user_json = user_parse_json.get();
    let from_value_user = user_parse_json.from_value(user_json);
    assert!(from_value_user.is_ok());

    let user = from_value_user.unwrap();
    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    let user_from = user_parse_json.from();
    assert!(user_from.is_ok());

    let user = user_from.unwrap();
    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[test]
fn parse_mutex() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .mutex()
        .get();

    let user = user.lock().unwrap();

    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.password, "password123");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[test]
fn parse_once_cell() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .once_cell();

    assert_eq!(user.get().unwrap().name, "John Doe");

    Ok(())
}

#[test]
fn parse_ref_cell() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .ref_cell()
        .get();

    {
        let mut user_borrow = user.borrow_mut();
        user_borrow.name = "Jane Doe".into();
    }

    assert_eq!(user.borrow().name, "Jane Doe");

    Ok(())
}

#[tokio::test]
async fn parse_tokio_mutex() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .tokio_mutex()
        .get();

    let user = user.lock().await;

    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.password, "password123");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[test]
fn parse_toml() -> Result<(), String> {
    let user_parse_toml = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .toml()
        .unwrap();

    let user_toml_value = user_parse_toml.get();
    let from_value_user = user_parse_toml.from_value(user_toml_value);
    assert!(from_value_user.is_ok());

    let user = from_value_user.unwrap();
    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    let user_from = user_parse_toml.from();
    assert!(user_from.is_ok());

    let user = user_from.unwrap();
    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[test]
fn parse_tuple() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse();

    let (id, name, password, email, age, gender) = user.tuple();

    assert_eq!(id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(name, "John Doe");
    assert_eq!(password, "password123");
    assert_eq!(email, "johndoe@example.com");
    assert_eq!(age, &25);
    assert_eq!(gender, "F");

    Ok(())
}

#[test]
fn parse_unsafe_cell() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .unsafe_cell()
        .get();

    let user_ptr = user.get();
    unsafe {
        (*user_ptr).name = "Jane Doe".into();
    }

    unsafe {
        assert_eq!((*user_ptr).name, "Jane Doe");
    }

    Ok(())
}

#[test]
fn parse_vec() -> Result<(), String> {
    let users = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse()
        .vec()
        .get();

    assert_eq!(users.len(), 1);

    let user = &users[0];

    assert_eq!(user.id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(user.name, "John Doe");
    assert_eq!(user.password, "password123");
    assert_eq!(user.email, "johndoe@example.com");
    assert_eq!(user.age, 25);
    assert_eq!(user.gender, "F");

    Ok(())
}

#[tokio::test]
async fn use_field_tokio_mutex_and_tuple() -> Result<(), String> {
    let user = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?)
        .parse();

    let (id, name, password, email, age, gender) = user.tuple();
    assert_eq!(id, "123e4567-e89b-12d3-a456-426614174000");
    assert_eq!(name, "John Doe");
    assert_eq!(password, "password123");
    assert_eq!(email, "johndoe@example.com");
    assert_eq!(age, &25);
    assert_eq!(gender, "F");

    #[cfg(feature = "tokio")]
    {
        let name_tokio = User::new()
            .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
            .name(UserName::new("John Doe")?)
            .password(UserPassword::new("password123")?)
            .email(UserEmail::new("johndoe@example.com")?)
            .age(UserAge::new(25)?)
            .gender(UserGender::new("F")?)
            .parse()
            .field()
            .name()
            .tokio_mutex();

        let mut locked = name_tokio.0.lock().await;
        assert_eq!(locked.as_str(), "John Doe");
        *locked = "Jane Doe".into();
        assert_eq!(locked.as_str(), "Jane Doe");
    }

    Ok(())
}

#[test]
fn use_field_basic_and_wrappers() -> Result<(), String> {
    let base = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?)
        .password(UserPassword::new("password123")?)
        .email(UserEmail::new("johndoe@example.com")?)
        .age(UserAge::new(25)?)
        .gender(UserGender::new("F")?);

    let wrapped = base.clone().parse().field().name();
    match wrapped {
        FieldName(ParseUserName(inner)) => {
            assert_eq!(inner, "John Doe");
        }
    }

    let name_arc = base.clone().parse().field().name().arc();
    assert_eq!(&*name_arc.0, "John Doe");

    let name_box = base.clone().parse().field().name().boxed();
    assert_eq!(*name_box.0, "John Doe");

    let name_cell = base.clone().parse().field().name().ref_cell();
    {
        let mut borrow = name_cell.0.borrow_mut();
        *borrow = "Jane Doe".into();
    }
    assert_eq!(name_cell.0.borrow().as_str(), "Jane Doe");

    let name_once = base.clone().parse().field().name().once_cell();
    assert_eq!(name_once.0.get().unwrap(), "John Doe");

    let name_vec = base.clone().parse().field().name().vec();
    assert_eq!(name_vec.0.len(), 1);
    assert_eq!(name_vec.0[0], "John Doe");

    let name_bin = base
        .clone()
        .parse()
        .field()
        .name()
        .bin()
        .map_err(|e| e.to_string())?;
    assert!(!name_bin.0.is_empty());

    let name_json = base
        .clone()
        .parse()
        .field()
        .name()
        .json()
        .map_err(|e| e.to_string())?;
    assert_eq!(name_json.0, "John Doe");

    let hm = base.clone().parse().field().name().hashmap();
    let boxed = hm.0.get("name").expect("expected key 'name'");
    let any_ref: &dyn Any = &**boxed;
    if let Some(s) = any_ref.downcast_ref::<String>() {
        assert_eq!(s.as_str(), "John Doe");
    } else {
        panic!("expected String inside HashMap");
    }

    let uc = base.clone().parse().field().name().unsafe_cell();
    let ptr = uc.0.get();
    unsafe {
        assert_eq!(&*ptr, "John Doe");
    }

    let m = base.clone().parse().field().name().mutex();
    let guard = m.0.lock().unwrap();
    assert_eq!(&*guard, "John Doe");

    Ok(())
}

#[test]
fn serialization_wrappers() -> Result<(), Box<dyn std::error::Error>> {
    let base = User::new()
        .id(UserId::new("123e4567-e89b-12d3-a456-426614174000")?)
        .name(UserName::new("John Doe")?);

    let name_bin = base.clone().parse().field().name().bin()?;
    assert!(!name_bin.0.is_empty());

    let name_json = base.parse().field().name().json()?;
    assert_eq!(name_json.0, "John Doe");

    Ok(())
}

#[test]
#[cfg(feature = "mutex")]
fn mutex_wrappers() {
    let base = User::new().name(UserName::new("John Doe").unwrap());
    let m = base.parse().field().name().mutex();
    let guard = m.0.lock().unwrap();
    assert_eq!(&*guard, "John Doe");
}

#[test]
#[cfg(feature = "tokio")]
fn tokio_mutex_wrappers() {
    let rt = tokio::runtime::Runtime::new().unwrap();
    let base = User::new().name(UserName::new("John Doe").unwrap());
    rt.block_on(async {
        let tm = base.parse().field().name().tokio_mutex();
        let guard = tm.0.lock().await;
        assert_eq!(&*guard, "John Doe");
    });
}

#[test]
#[cfg(feature = "unsafecell")]
fn unsafe_cell_wrappers() {
    let base = User::new().name(UserName::new("John Doe").unwrap());
    let uc = base.parse().field().name().unsafe_cell();
    let ptr = uc.0.get();
    unsafe {
        assert_eq!(&*ptr, "John Doe");
    }
}

```

---

<h2 align="center">
  <strong>❤️ Donate</strong>
</h2>

<p align="center">
  <a href="https://github.com/pas2rust/pas2rust/blob/main/pas-monero-donate.png" style="text-decoration:none; color:inherit;">
    <img src="https://img.shields.io/badge/Monero%20QR-FF6600?style=flat&logo=monero&logoColor=white" alt="Monero QR"/>
  </a>
  <a href="https://github.com/pas2rust/pas2rust/blob/main/pas-bitcoin-donate.png" style="text-decoration:none; color:inherit;">
    <img src="https://img.shields.io/badge/BTC%20QR-EAB300?style=flat&logo=bitcoin&logoColor=white" alt="BTC QR"/>
  </a>
  <a href="https://revolut.me/pas2rust" style="text-decoration:none; color:inherit;">
    <img src="https://img.shields.io/badge/Revolut%20QR-Blue?style=flat&logo=revolut&logoColor=white" alt="Revolut QR"/>
  </a>
  <a href="https://wise.com/pay/me/pedroaugustos99" style="text-decoration:none; color:inherit;">
    <img src="https://img.shields.io/badge/Wise%20QR-1CA0F2?style=flat&logo=wise&logoColor=white" alt="Wise QR"/>
  </a>
</p>


---