Skip to main content

tpack_core/
native.rs

1use crate::{Result, Schema, TpackValue};
2
3pub trait TpackSerialize {
4    fn schema() -> Schema
5    where
6        Self: Sized;
7
8    fn to_value(&self) -> TpackValue<'_>;
9}
10
11pub trait TpackDeserialize<'de>: Sized {
12    fn schema() -> Schema;
13
14    fn from_value(value: TpackValue<'de>) -> Result<Self>;
15}
16
17pub trait FromTpackValue<'de>: Sized {
18    fn from_value(value: TpackValue<'de>) -> Result<Self>;
19}
20
21mod collections;
22mod helpers;
23mod primitives;
24mod text;