Skip to main content

pack_io/
view.rs

1//! Zero-copy decoding: the [`DeserializeView`] trait, the [`decode_view`]
2//! free function, and built-in impls for the types that can borrow directly
3//! from the input buffer.
4//!
5//! ## The two decode surfaces
6//!
7//! [`Deserialize`] produces an **owning** value — `String`s and `Vec<u8>`s
8//! are allocated, the input buffer can be dropped immediately after the
9//! call. Use it when the input is transient (a network buffer being
10//! recycled, a file being streamed) or when downstream code holds the
11//! decoded value for an unbounded lifetime.
12//!
13//! [`DeserializeView`] produces a **borrowed** value — `&'a str` and
14//! `&'a [u8]` fields point directly into the input slice. No per-field
15//! allocation. Use it when the input buffer outlives the decoded value
16//! (e.g. a memory-mapped file, an arena, a request-lifetime byte buffer).
17//!
18//! Both surfaces share the same on-wire format. A value encoded with
19//! [`crate::encode`] can be read with either [`crate::decode`] (owning) or
20//! [`decode_view`] (borrowed); choose the one that matches the lifetime
21//! relationship the caller has with the source bytes. Both enforce the same
22//! [`Config`] limits.
23//!
24//! ## Built-in implementors
25//!
26//! - `&'a str`, `&'a [u8]`, `Cow<'a, str>`, `Cow<'a, [u8]>` — the headline
27//!   zero-copy types (the `Cow`s come back as `Cow::Borrowed`).
28//! - Every primitive (`u8` … `u128`, `i8` … `i128`, `usize`, `isize`,
29//!   `bool`, `char`, `f32`, `f64`, `()`), `NonZero*`, `Duration`,
30//!   `PhantomData<T>` — `DeserializeView` reduces to [`Deserialize`] for
31//!   these, no borrow involved.
32//! - Owned text: `String`, `Box<str>`, `Rc<str>`, `Arc<str>`; `Box<T>` for
33//!   any `T: DeserializeView`.
34//! - `Option<T>`, `Result<T, E>`, tuples `(T1, …, Tn)` (arity 1–12),
35//!   fixed-size arrays `[T; N]`.
36//! - `Vec<T>`, `VecDeque<T>` and the standard `BTreeMap` / `BTreeSet` /
37//!   `HashMap` / `HashSet` — these have to allocate the container itself,
38//!   but their element / key / value types may still be borrows.
39//!
40//! User-defined types implement [`DeserializeView`] directly or via the
41//! `#[derive(DeserializeView)]` macro (`feature = "derive"`), which also
42//! works on types without a lifetime parameter so they can be nested inside
43//! borrowing views.
44
45use alloc::borrow::Cow;
46use alloc::boxed::Box;
47use alloc::collections::{BTreeMap, BTreeSet, VecDeque};
48use alloc::rc::Rc;
49use alloc::string::String;
50#[cfg(target_has_atomic = "ptr")]
51use alloc::sync::Arc;
52use alloc::vec::Vec;
53use core::marker::PhantomData;
54use core::num::{
55    NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroIsize, NonZeroU8,
56    NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize,
57};
58use core::time::Duration;
59#[cfg(feature = "std")]
60use std::collections::{HashMap, HashSet};
61#[cfg(feature = "std")]
62use std::hash::{BuildHasher, Hash};
63
64use crate::codec::{
65    Config, Decode, Decoder, decode_elements_counted, finish, guard_element_count, initial_capacity,
66};
67use crate::error::{Result, SerialError};
68use crate::impls::KeyOrder;
69use crate::traits::Deserialize;
70
71// ---------------------------------------------------------------------------
72// Trait + free function
73// ---------------------------------------------------------------------------
74
75/// Types that decode by **borrowing** directly from the input slice rather
76/// than allocating owned copies.
77///
78/// `'a` is the lifetime of the underlying byte buffer; every borrowed field
79/// in the decoded value points into that buffer. The borrow checker
80/// guarantees the value cannot outlive its source.
81///
82/// # Examples
83///
84/// Borrow string and byte fields out of a request buffer:
85///
86/// ```
87/// use pack_io::{decode_view, Decode, Decoder, DeserializeView, Result, Serialize, Encode};
88///
89/// // Pair of borrowed and owned versions for round-tripping.
90/// struct OwnedMsg { id: u64, text: String, payload: Vec<u8> }
91/// struct ViewMsg<'a> { id: u64, text: &'a str, payload: &'a [u8] }
92///
93/// impl Serialize for OwnedMsg {
94///     fn serialize<E: Encode + ?Sized>(&self, e: &mut E) -> Result<()> {
95///         self.id.serialize(e)?; self.text.serialize(e)?; self.payload.serialize(e)
96///     }
97/// }
98/// impl<'a> DeserializeView<'a> for ViewMsg<'a> {
99///     fn deserialize_view(d: &mut Decoder<'a>) -> Result<Self> {
100///         Ok(ViewMsg {
101///             id:      u64::deserialize_view(d)?,
102///             text:    <&str>::deserialize_view(d)?,
103///             payload: <&[u8]>::deserialize_view(d)?,
104///         })
105///     }
106/// }
107///
108/// let bytes = pack_io::encode(&OwnedMsg {
109///     id: 7,
110///     text: "hello".into(),
111///     payload: vec![1, 2, 3],
112/// }).unwrap();
113///
114/// let view: ViewMsg<'_> = decode_view(&bytes).unwrap();
115/// assert_eq!(view.text, "hello");        // &str borrowed from `bytes`
116/// assert_eq!(view.payload, &[1, 2, 3]);  // &[u8] borrowed from `bytes`
117/// ```
118pub trait DeserializeView<'a>: Sized {
119    /// Read a value of `Self` from `decoder`, borrowing from its
120    /// underlying input slice where possible.
121    ///
122    /// # Errors
123    ///
124    /// Any [`crate::SerialError`] the underlying byte reads surface.
125    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self>;
126
127    /// Read `count` consecutive `Self` values into a `Vec`.
128    ///
129    /// The view-side counterpart of [`Deserialize::deserialize_many`]. The
130    /// default decodes one element at a time with a bounded initial
131    /// capacity; `u8` overrides it with one bounds check and one copy, so a
132    /// `Vec<u8>` field in a view struct is not decoded byte by byte.
133    ///
134    /// # Errors
135    ///
136    /// Propagates any error returned by the per-element / bulk read.
137    fn deserialize_view_many(decoder: &mut Decoder<'a>, count: usize) -> Result<Vec<Self>> {
138        let mut out = Vec::with_capacity(initial_capacity::<Self, Decoder<'a>>(count, decoder));
139        decode_elements_counted::<Self, Decoder<'a>, _>(decoder, count, |decoder| {
140            out.push(Self::deserialize_view(decoder)?);
141            Ok(())
142        })?;
143        Ok(out)
144    }
145
146    /// Read `N` consecutive `Self` values into an array. `u8` overrides it
147    /// with a single read into a stack array.
148    ///
149    /// # Errors
150    ///
151    /// Propagates any error returned by the per-element / bulk read.
152    fn deserialize_view_array<const N: usize>(decoder: &mut Decoder<'a>) -> Result<[Self; N]> {
153        let mut out: Vec<Self> = Vec::with_capacity(N);
154        for _ in 0..N {
155            out.push(Self::deserialize_view(decoder)?);
156        }
157        // Exactly `N` elements were pushed, so this cannot fail.
158        out.try_into()
159            .map_err(|_| SerialError::custom("array length mismatch"))
160    }
161}
162
163/// Decode a borrowed value of type `T` from `bytes`, requiring the input to
164/// be fully consumed.
165///
166/// This is the **Tier-1** zero-copy entry point — the symmetric counterpart
167/// to [`crate::decode`]. The decoded value borrows from `bytes`; the
168/// borrow checker enforces that `bytes` outlives the result.
169///
170/// # Examples
171///
172/// ```
173/// let bytes = pack_io::encode(&"hello").unwrap();
174/// let view: &str = pack_io::decode_view(&bytes).unwrap();
175/// assert_eq!(view, "hello");
176/// ```
177///
178/// # Errors
179///
180/// - Returns [`SerialError::TrailingBytes`] when extra bytes follow the value.
181/// - Propagates any [`SerialError`] from the type's [`DeserializeView`] impl.
182#[inline]
183pub fn decode_view<'a, T: DeserializeView<'a>>(bytes: &'a [u8]) -> Result<T> {
184    let mut dec = Decoder::new(bytes);
185    let value = T::deserialize_view(&mut dec)?;
186    finish(&dec, value)
187}
188
189/// [`decode_view`] under an explicit [`Config`].
190///
191/// # Examples
192///
193/// ```
194/// use pack_io::{Config, SerialError, decode_view_with_config, encode};
195///
196/// let bytes = encode(&"a fairly long string").unwrap();
197/// let tight = Config::new().with_max_alloc(8);
198/// let err = decode_view_with_config::<&str>(&bytes, tight).unwrap_err();
199/// assert!(matches!(err, SerialError::InvalidLength { .. }));
200/// ```
201///
202/// # Errors
203///
204/// - Any error [`Decoder::with_config`] reports for an invalid `config`.
205/// - [`SerialError::TrailingBytes`] when extra bytes follow the value.
206/// - Any [`SerialError`] from the type's [`DeserializeView`] impl.
207#[inline]
208pub fn decode_view_with_config<'a, T: DeserializeView<'a>>(
209    bytes: &'a [u8],
210    config: Config,
211) -> Result<T> {
212    let mut dec = Decoder::with_config(bytes, config)?;
213    let value = T::deserialize_view(&mut dec)?;
214    finish(&dec, value)
215}
216
217// ---------------------------------------------------------------------------
218// Borrowed primitives
219// ---------------------------------------------------------------------------
220
221impl<'a> DeserializeView<'a> for &'a str {
222    #[inline]
223    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
224        let bytes = decoder.read_length_prefixed_borrowed()?;
225        core::str::from_utf8(bytes).map_err(|_| SerialError::InvalidUtf8)
226    }
227}
228
229impl<'a> DeserializeView<'a> for &'a [u8] {
230    #[inline]
231    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
232        decoder.read_length_prefixed_borrowed()
233    }
234}
235
236impl<'a> DeserializeView<'a> for Cow<'a, str> {
237    #[inline]
238    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
239        <&'a str>::deserialize_view(decoder).map(Cow::Borrowed)
240    }
241}
242
243impl<'a> DeserializeView<'a> for Cow<'a, [u8]> {
244    #[inline]
245    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
246        <&'a [u8]>::deserialize_view(decoder).map(Cow::Borrowed)
247    }
248}
249
250// ---------------------------------------------------------------------------
251// Fixed-size scalars and owned text: DeserializeView ≡ Deserialize
252// ---------------------------------------------------------------------------
253
254macro_rules! view_via_owned {
255    ($($t:ty),+ $(,)?) => {
256        $(
257            impl<'a> DeserializeView<'a> for $t {
258                #[inline]
259                fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
260                    <$t as Deserialize>::deserialize(decoder)
261                }
262            }
263        )+
264    };
265}
266
267view_via_owned!(
268    u16,
269    u32,
270    u64,
271    u128,
272    usize,
273    i8,
274    i16,
275    i32,
276    i64,
277    i128,
278    isize,
279    bool,
280    char,
281    f32,
282    f64,
283    (),
284    String,
285    Box<str>,
286    Rc<str>,
287    Duration,
288    NonZeroU8,
289    NonZeroU16,
290    NonZeroU32,
291    NonZeroU64,
292    NonZeroU128,
293    NonZeroUsize,
294    NonZeroI8,
295    NonZeroI16,
296    NonZeroI32,
297    NonZeroI64,
298    NonZeroI128,
299    NonZeroIsize,
300);
301
302#[cfg(target_has_atomic = "ptr")]
303view_via_owned!(Arc<str>);
304
305impl<'a> DeserializeView<'a> for u8 {
306    #[inline]
307    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
308        decoder.read_byte()
309    }
310
311    /// One bounds check and one copy for `Vec<u8>` fields in view structs.
312    #[inline]
313    fn deserialize_view_many(decoder: &mut Decoder<'a>, count: usize) -> Result<Vec<Self>> {
314        decoder.read_borrowed(count).map(<[u8]>::to_vec)
315    }
316
317    /// `[u8; N]` in a view struct is one read into a stack array.
318    #[inline]
319    fn deserialize_view_array<const N: usize>(decoder: &mut Decoder<'a>) -> Result<[Self; N]> {
320        <u8 as Deserialize>::deserialize_array::<Decoder<'a>, N>(decoder)
321    }
322}
323
324impl<'a, T: DeserializeView<'a>> DeserializeView<'a> for Box<T> {
325    #[inline]
326    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
327        T::deserialize_view(decoder).map(Box::new)
328    }
329}
330
331impl<'a, T: ?Sized> DeserializeView<'a> for PhantomData<T> {
332    #[inline]
333    fn deserialize_view(_decoder: &mut Decoder<'a>) -> Result<Self> {
334        Ok(PhantomData)
335    }
336}
337
338// ---------------------------------------------------------------------------
339// Containers: Option, Result, tuples, arrays — propagate the lifetime
340// ---------------------------------------------------------------------------
341
342impl<'a, T: DeserializeView<'a>> DeserializeView<'a> for Option<T> {
343    #[inline]
344    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
345        match decoder.read_byte()? {
346            0x00 => Ok(None),
347            0x01 => Ok(Some(T::deserialize_view(decoder)?)),
348            tag => Err(SerialError::InvalidTag {
349                kind: "Option",
350                tag,
351            }),
352        }
353    }
354}
355
356impl<'a, T: DeserializeView<'a>, E: DeserializeView<'a>> DeserializeView<'a>
357    for core::result::Result<T, E>
358{
359    #[inline]
360    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
361        match decoder.read_byte()? {
362            0x00 => Ok(Ok(T::deserialize_view(decoder)?)),
363            0x01 => Ok(Err(E::deserialize_view(decoder)?)),
364            tag => Err(SerialError::InvalidTag {
365                kind: "Result",
366                tag,
367            }),
368        }
369    }
370}
371
372impl<'a, T: DeserializeView<'a>, const N: usize> DeserializeView<'a> for [T; N] {
373    #[inline]
374    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
375        T::deserialize_view_array::<N>(decoder)
376    }
377}
378
379impl<'a, T: DeserializeView<'a>> DeserializeView<'a> for Vec<T> {
380    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
381        let declared = decoder.read_varint_u64()?;
382        let len = guard_element_count(declared, decoder)?;
383        T::deserialize_view_many(decoder, len)
384    }
385}
386
387impl<'a, T: DeserializeView<'a>> DeserializeView<'a> for VecDeque<T> {
388    #[inline]
389    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
390        Vec::<T>::deserialize_view(decoder).map(VecDeque::from)
391    }
392}
393
394macro_rules! view_tuple {
395    ($($name:ident),+) => {
396        impl<'a, $($name: DeserializeView<'a>),+> DeserializeView<'a> for ($($name,)+) {
397            #[inline]
398            fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
399                Ok(( $( $name::deserialize_view(decoder)?, )+ ))
400            }
401        }
402    };
403}
404
405view_tuple!(T0);
406view_tuple!(T0, T1);
407view_tuple!(T0, T1, T2);
408view_tuple!(T0, T1, T2, T3);
409view_tuple!(T0, T1, T2, T3, T4);
410view_tuple!(T0, T1, T2, T3, T4, T5);
411view_tuple!(T0, T1, T2, T3, T4, T5, T6);
412view_tuple!(T0, T1, T2, T3, T4, T5, T6, T7);
413view_tuple!(T0, T1, T2, T3, T4, T5, T6, T7, T8);
414view_tuple!(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9);
415view_tuple!(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10);
416view_tuple!(T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11);
417
418// ---------------------------------------------------------------------------
419// Map / set collections: the container is allocated, but K / V may borrow.
420// ---------------------------------------------------------------------------
421
422/// Decode `len` borrowed `(K, V)` entries, enforcing strictly increasing
423/// encoded keys in canonical mode and charging entries that consume no
424/// input against `max_alloc`.
425fn view_entries<'a, K, V, F>(decoder: &mut Decoder<'a>, len: usize, mut insert: F) -> Result<()>
426where
427    K: DeserializeView<'a>,
428    V: DeserializeView<'a>,
429    F: FnMut(K, V),
430{
431    let mut order = decoder
432        .config()
433        .canonical
434        .then(|| KeyOrder::new("map key order"));
435    decode_elements_counted::<(K, V), Decoder<'a>, _>(decoder, len, |decoder| {
436        let start = decoder.position();
437        let k = K::deserialize_view(decoder)?;
438        if let Some(order) = order.as_mut() {
439            order.check(decoder, start)?;
440        }
441        let v = V::deserialize_view(decoder)?;
442        insert(k, v);
443        Ok(())
444    })
445}
446
447/// Decode `len` borrowed set elements, enforcing strictly increasing
448/// encodings in canonical mode and charging elements that consume no input
449/// against `max_alloc`.
450fn view_elements<'a, T, F>(decoder: &mut Decoder<'a>, len: usize, mut insert: F) -> Result<()>
451where
452    T: DeserializeView<'a>,
453    F: FnMut(T),
454{
455    let mut order = decoder
456        .config()
457        .canonical
458        .then(|| KeyOrder::new("set element order"));
459    decode_elements_counted::<T, Decoder<'a>, _>(decoder, len, |decoder| {
460        let start = decoder.position();
461        let item = T::deserialize_view(decoder)?;
462        if let Some(order) = order.as_mut() {
463            order.check(decoder, start)?;
464        }
465        insert(item);
466        Ok(())
467    })
468}
469
470impl<'a, K, V> DeserializeView<'a> for BTreeMap<K, V>
471where
472    K: DeserializeView<'a> + Ord,
473    V: DeserializeView<'a>,
474{
475    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
476        let declared = decoder.read_varint_u64()?;
477        let len = guard_element_count(declared, decoder)?;
478        let mut out = BTreeMap::new();
479        view_entries(decoder, len, |k, v| {
480            let _ = out.insert(k, v);
481        })?;
482        Ok(out)
483    }
484}
485
486impl<'a, T> DeserializeView<'a> for BTreeSet<T>
487where
488    T: DeserializeView<'a> + Ord,
489{
490    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
491        let declared = decoder.read_varint_u64()?;
492        let len = guard_element_count(declared, decoder)?;
493        let mut out = BTreeSet::new();
494        view_elements(decoder, len, |item| {
495            let _ = out.insert(item);
496        })?;
497        Ok(out)
498    }
499}
500
501#[cfg(feature = "std")]
502impl<'a, K, V, S> DeserializeView<'a> for HashMap<K, V, S>
503where
504    K: DeserializeView<'a> + Hash + Eq,
505    V: DeserializeView<'a>,
506    S: BuildHasher + Default,
507{
508    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
509        let declared = decoder.read_varint_u64()?;
510        let len = guard_element_count(declared, decoder)?;
511        let capacity = initial_capacity::<(K, V), Decoder<'a>>(len, decoder);
512        let mut out = HashMap::with_capacity_and_hasher(capacity, S::default());
513        view_entries(decoder, len, |k, v| {
514            let _ = out.insert(k, v);
515        })?;
516        Ok(out)
517    }
518}
519
520#[cfg(feature = "std")]
521impl<'a, T, S> DeserializeView<'a> for HashSet<T, S>
522where
523    T: DeserializeView<'a> + Hash + Eq,
524    S: BuildHasher + Default,
525{
526    fn deserialize_view(decoder: &mut Decoder<'a>) -> Result<Self> {
527        let declared = decoder.read_varint_u64()?;
528        let len = guard_element_count(declared, decoder)?;
529        let capacity = initial_capacity::<T, Decoder<'a>>(len, decoder);
530        let mut out = HashSet::with_capacity_and_hasher(capacity, S::default());
531        view_elements(decoder, len, |item| {
532            let _ = out.insert(item);
533        })?;
534        Ok(out)
535    }
536}
537
538#[cfg(test)]
539mod tests {
540    use super::*;
541    use crate::encode;
542    use alloc::string::ToString;
543    use alloc::vec;
544
545    #[test]
546    fn borrowed_str_round_trips() {
547        let bytes = encode(&"hello").unwrap();
548        let view: &str = decode_view(&bytes).unwrap();
549        assert_eq!(view, "hello");
550    }
551
552    #[test]
553    fn borrowed_bytes_round_trip() {
554        let bytes = encode(&vec![1u8, 2, 3, 4, 5]).unwrap();
555        let view: &[u8] = decode_view(&bytes).unwrap();
556        assert_eq!(view, &[1, 2, 3, 4, 5]);
557    }
558
559    #[test]
560    fn primitive_view_decodes_like_owning() {
561        let bytes = encode(&42_u64).unwrap();
562        let n: u64 = decode_view(&bytes).unwrap();
563        assert_eq!(n, 42);
564    }
565
566    #[test]
567    fn option_borrowed_view_round_trips() {
568        let bytes = encode(&Some(String::from("hi"))).unwrap();
569        let v: Option<&str> = decode_view(&bytes).unwrap();
570        assert_eq!(v, Some("hi"));
571
572        let none_bytes = encode::<Option<String>>(&None).unwrap();
573        let v: Option<&str> = decode_view(&none_bytes).unwrap();
574        assert_eq!(v, None);
575    }
576
577    #[test]
578    fn tuple_with_borrowed_str_round_trips() {
579        let owned = (7_u64, String::from("hello"), true);
580        let bytes = encode(&owned).unwrap();
581        let view: (u64, &str, bool) = decode_view(&bytes).unwrap();
582        assert_eq!(view, (7, "hello", true));
583    }
584
585    #[test]
586    fn vec_of_borrowed_str_round_trips() {
587        let owned = vec![
588            String::from("alpha"),
589            String::from("beta"),
590            String::from("gamma"),
591        ];
592        let bytes = encode(&owned).unwrap();
593        let view: Vec<&str> = decode_view(&bytes).unwrap();
594        assert_eq!(view, vec!["alpha", "beta", "gamma"]);
595    }
596
597    #[test]
598    fn decode_view_rejects_trailing_bytes() {
599        let mut bytes = encode(&"hi").unwrap();
600        bytes.push(0xff);
601        let err = decode_view::<&str>(&bytes).expect_err("trailing bytes");
602        assert!(matches!(err, SerialError::TrailingBytes { remaining: 1 }));
603    }
604
605    #[test]
606    fn borrowed_str_with_invalid_utf8_is_rejected() {
607        let bytes = [0x02u8, 0xff, 0xff];
608        let err = decode_view::<&str>(&bytes).expect_err("invalid utf-8");
609        assert!(matches!(err, SerialError::InvalidUtf8));
610    }
611
612    #[test]
613    fn map_with_borrowed_keys_round_trips() {
614        let mut owned: BTreeMap<String, u32> = BTreeMap::new();
615        let _ = owned.insert("alpha".to_string(), 1);
616        let _ = owned.insert("beta".to_string(), 2);
617        let bytes = encode(&owned).unwrap();
618        let view: BTreeMap<&str, u32> = decode_view(&bytes).unwrap();
619        assert_eq!(view.get("alpha"), Some(&1));
620        assert_eq!(view.get("beta"), Some(&2));
621    }
622}