devela::_dep::rkyv

Trait Serialize

pub trait Serialize<S>: Archive
where S: Fallible + ?Sized,
{ // Required method fn serialize( &self, serializer: &mut S, ) -> Result<Self::Resolver, <S as Fallible>::Error> ; }
Available on crate feature dep_rkyv only.
Expand description

Converts a type to its archived form.

Objects perform any supportive serialization during serialize. For types that reference nonlocal (pointed-to) data, this is when that data must be serialized to the output. These types will need to bound S to implement Writer and any other required traits (e.g. Sharing). They should then serialize their dependencies during serialize.

See Archive for examples of implementing Serialize.

Required Methods§

fn serialize( &self, serializer: &mut S, ) -> Result<Self::Resolver, <S as Fallible>::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl<S> Serialize<S> for bool
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<bool as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for char
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<char as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for f32
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<f32 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for f64
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<f64 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for i8
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<i8 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for i16
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<i16 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for i32
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<i32 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for i64
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<i64 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for i128
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<i128 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for isize
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<isize as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for u8
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<u8 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for u16
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<u16 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for u32
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<u32 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for u64
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<u64 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for u128
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<u128 as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for ()
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<() as Archive>::Resolver, <S as Fallible>::Error>

§

impl<S> Serialize<S> for usize
where S: Fallible + ?Sized,

§

fn serialize( &self, _: &mut S, ) -> Result<<usize as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, S> Serialize<S> for (T0,)
where T0: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<(T0,) as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, T1, S> Serialize<S> for (T0, T1)
where T0: Serialize<S>, T1: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<(T0, T1) as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, T1, T2, S> Serialize<S> for (T0, T1, T2)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<(T0, T1, T2) as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, T1, T2, T3, S> Serialize<S> for (T0, T1, T2, T3)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<(T0, T1, T2, T3) as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, T1, T2, T3, T4, S> Serialize<S> for (T0, T1, T2, T3, T4)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<(T0, T1, T2, T3, T4) as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, T1, T2, T3, T4, T5, S> Serialize<S> for (T0, T1, T2, T3, T4, T5)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<(T0, T1, T2, T3, T4, T5) as Archive>::Resolver, <S as Fallible>::Error>

§

impl<T0, T1, T2, T3, T4, T5, T6, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, S: Fallible + ?Sized,

§

impl<T0, T1, T2, T3, T4, T5, T6, T7, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6, T7)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, T7: Serialize<S>, S: Fallible + ?Sized,

§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6, T7, T8)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, T7: Serialize<S>, T8: Serialize<S>, S: Fallible + ?Sized,

§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, T7: Serialize<S>, T8: Serialize<S>, T9: Serialize<S>, S: Fallible + ?Sized,

§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, T7: Serialize<S>, T8: Serialize<S>, T9: Serialize<S>, T10: Serialize<S>, S: Fallible + ?Sized,

§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, T7: Serialize<S>, T8: Serialize<S>, T9: Serialize<S>, T10: Serialize<S>, T11: Serialize<S>, S: Fallible + ?Sized,

§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, S> Serialize<S> for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
where T0: Serialize<S>, T1: Serialize<S>, T2: Serialize<S>, T3: Serialize<S>, T4: Serialize<S>, T5: Serialize<S>, T6: Serialize<S>, T7: Serialize<S>, T8: Serialize<S>, T9: Serialize<S>, T10: Serialize<S>, T11: Serialize<S>, T12: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S, const N: usize> Serialize<S> for [T; N]
where T: Serialize<S>, S: Fallible + ?Sized,

§

fn serialize( &self, serializer: &mut S, ) -> Result<<[T; N] as Archive>::Resolver, <S as Fallible>::Error>

Implementors§

§

impl<K, S> Serialize<S> for BTreeSet<K>
where K: Serialize<S> + Ord, <K as Archive>::Archived: Ord, S: Fallible + Allocator + Writer + ?Sized, <S as Fallible>::Error: Source,

§

impl<K, S, RS> Serialize<S> for devela::all::HashSet<K, RS>
where <K as Archive>::Archived: Hash + Eq, K: Serialize<S> + Hash + Eq, S: Fallible + Allocator + Writer + ?Sized, <S as Fallible>::Error: Source,

§

impl<K, S, RS> Serialize<S> for devela::_dep::_std::collections::HashSet<K, RS>
where <K as Archive>::Archived: Hash + Eq, K: Serialize<S> + Hash + Eq, S: Fallible + Allocator + Writer + ?Sized, <S as Fallible>::Error: Source,

§

impl<K, V, S> Serialize<S> for BTreeMap<K, V>
where K: Serialize<S> + Ord, <K as Archive>::Archived: Ord, V: Serialize<S>, S: Allocator + Fallible + Writer + ?Sized, <S as Fallible>::Error: Source,

§

impl<K, V, S, RandomState> Serialize<S> for devela::all::HashMap<K, V, RandomState>
where K: Serialize<S> + Hash + Eq, <K as Archive>::Archived: Hash + Eq, V: Serialize<S>, S: Fallible + Writer + Allocator + ?Sized, <S as Fallible>::Error: Source,

§

impl<K, V, S, RandomState> Serialize<S> for devela::_dep::_std::collections::HashMap<K, V, RandomState>
where K: Serialize<S> + Hash + Eq, <K as Archive>::Archived: Hash + Eq, V: Serialize<S>, S: Fallible + Writer + Allocator + ?Sized, <S as Fallible>::Error: Source,

§

impl<S> Serialize<S> for IpAddr
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for SocketAddr
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for Ipv4Addr
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for Ipv6Addr
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for SocketAddrV4
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for SocketAddrV6
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<i8>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<i16>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<i32>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<i64>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<i128>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<isize>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<u8>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<u16>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<u32>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<u64>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<u128>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZero<usize>
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for PhantomPinned
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for RangeFull
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for String
where S: Fallible + ?Sized, <S as Fallible>::Error: Source, str: SerializeUnsized<S>,

§

impl<S> Serialize<S> for CString
where S: Fallible + Writer + ?Sized,

§

impl<S> Serialize<S> for Duration
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI16_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI16_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI32_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI32_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI64_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI64_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI128_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroI128_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU16_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU16_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU32_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU32_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU64_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU64_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU128_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for NonZeroU128_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for char_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for char_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for f32_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for f32_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for f64_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for f64_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i16_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i16_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i32_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i32_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i64_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i64_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i128_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for i128_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u16_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u16_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u32_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u32_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u64_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u64_le
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u128_be
where S: Fallible + ?Sized,

§

impl<S> Serialize<S> for u128_le
where S: Fallible + ?Sized,

§

impl<S, BK, BV, K, V> Serialize<S> for EntryAdapter<BK, BV, K, V>
where S: Fallible + ?Sized, BK: Borrow<K>, BV: Borrow<V>, K: Serialize<S>, V: Serialize<S>,

§

impl<S, F, W> Serialize<S> for With<F, W>
where S: Fallible + ?Sized, W: SerializeWith<F, S>, F: ?Sized,

§

impl<T, S> Serialize<S> for Option<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for Bound<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for Box<T>
where T: SerializeUnsized<S> + ?Sized, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for ManuallyDrop<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for PhantomData<T>
where S: Fallible + ?Sized, T: ?Sized,

§

impl<T, S> Serialize<S> for Range<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for RangeFrom<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for RangeInclusive<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for RangeTo<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for RangeToInclusive<T>
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> Serialize<S> for Rc<T>
where T: SerializeUnsized<S> + 'static + ?Sized, S: Fallible + Writer + Sharing + ?Sized, <S as Fallible>::Error: Source,

§

impl<T, S> Serialize<S> for devela::all::RcWeak<T>
where T: SerializeUnsized<S> + 'static + ?Sized, S: Fallible + Writer + Sharing + ?Sized, <S as Fallible>::Error: Source,

§

impl<T, S> Serialize<S> for Vec<T>
where T: Serialize<S>, S: Fallible + Allocator + Writer + ?Sized,

§

impl<T, S> Serialize<S> for VecDeque<T>
where T: Serialize<S>, S: Fallible + Allocator + Writer + ?Sized,

§

impl<T, S> Serialize<S> for Arc<T>
where T: SerializeUnsized<S> + 'static + ?Sized, S: Fallible + Writer + Sharing + ?Sized, <S as Fallible>::Error: Source,

§

impl<T, S> Serialize<S> for devela::work::ArcWeak<T>
where T: SerializeUnsized<S> + 'static + ?Sized, S: Fallible + Writer + Sharing + ?Sized, <S as Fallible>::Error: Source,

§

impl<T, U, S> Serialize<S> for Result<T, U>
where T: Serialize<S>, U: Serialize<S>, S: Fallible + ?Sized,

Source§

impl<__S: Fallible + ?Sized> Serialize<__S> for Boxed

Available on crate feature alloc only.
Source§

impl<__S: Fallible + ?Sized, T> Serialize<__S> for BareBox<T>
where T: Serialize<__S>,

Source§

impl<__S: Fallible + ?Sized, T, const C: usize, const R: usize, const CR: usize, const RMAJ: bool, S: Storage> Serialize<__S> for Array2d<T, C, R, CR, RMAJ, S>
where Array<T, CR, S>: Serialize<__S>,

Source§

impl<__S: Fallible + ?Sized, T, const CAP: usize, IDX, S: Storage> Serialize<__S> for Destaque<T, CAP, IDX, S>
where Array<T, CAP, S>: Serialize<__S>, IDX: Serialize<__S>,

Source§

impl<__S: Fallible + ?Sized, T, const CAP: usize, IDX, S: Storage> Serialize<__S> for Stack<T, CAP, IDX, S>
where Array<T, CAP, S>: Serialize<__S>, IDX: Serialize<__S>,

Source§

impl<__S: Fallible + ?Sized, T, const CAP: usize, S: Storage> Serialize<__S> for Array<T, CAP, S>
where S::Stored<[T; CAP]>: Serialize<__S>,