devela::_dep::rkyv::with

Trait SerializeWith

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

A variant of Serialize for “with” types.

See ArchiveWith for more details.

Required Methods§

fn serialize_with( field: &F, serializer: &mut S, ) -> Result<Self::Resolver, <S as Fallible>::Error>

Serializes the field type F using the given serializer.

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.

Implementors§

§

impl<'a, F, S> SerializeWith<Cow<'a, F>, S> for AsOwned
where F: Serialize<S> + Clone, S: Fallible + ?Sized,

§

impl<'a, S> SerializeWith<Cow<'a, str>, S> for AsOwned
where S: Fallible + Writer + ?Sized, <S as Fallible>::Error: Source,

§

impl<'a, S> SerializeWith<Cow<'a, CStr>, S> for AsOwned
where S: Fallible + Writer + ?Sized,

§

impl<'a, T, S> SerializeWith<Cow<'a, [T]>, S> for AsOwned
where T: Serialize<S> + Clone, S: Fallible + Allocator + Writer + ?Sized,

§

impl<A, B, K, V, H, S> SerializeWith<HashMap<K, V, H>, S> for MapKV<A, B>
where A: ArchiveWith<K> + SerializeWith<K, S>, B: ArchiveWith<V> + SerializeWith<V, S>, K: Hash + Eq, <A as ArchiveWith<K>>::Archived: Eq + Hash, S: Fallible + Writer + Allocator + ?Sized, <S as Fallible>::Error: Source, H: Default + BuildHasher, <H as BuildHasher>::Hasher: Default,

§

impl<A, B, K, V, S> SerializeWith<BTreeMap<K, V>, S> for MapKV<A, B>
where A: ArchiveWith<K> + SerializeWith<K, S>, B: ArchiveWith<V> + SerializeWith<V, S>, <A as ArchiveWith<K>>::Archived: Ord, S: Fallible + Allocator + Writer + ?Sized, <S as Fallible>::Error: Source,

§

impl<A, B, K, V, S, H> SerializeWith<HashMap<K, V, H>, S> for MapKV<A, B>
where A: ArchiveWith<K> + SerializeWith<K, S>, B: ArchiveWith<V> + SerializeWith<V, S>, K: Hash + Eq, <A as ArchiveWith<K>>::Archived: Eq + Hash, S: Fallible + Allocator + Writer + ?Sized, <S as Fallible>::Error: Source, H: Default + BuildHasher, <H as BuildHasher>::Hasher: Default,

§

impl<A, O, S> SerializeWith<Option<O>, S> for Map<A>
where S: Fallible + ?Sized, A: ArchiveWith<O> + SerializeWith<O, S>,

§

impl<A, O, S> SerializeWith<Vec<O>, S> for Map<A>
where S: Fallible + Allocator + Writer + ?Sized, A: ArchiveWith<O> + SerializeWith<O, S>,

§

impl<F, S> SerializeWith<&F, S> for Inline
where F: Serialize<S>, S: Fallible + ?Sized,

§

impl<F, S> SerializeWith<&F, S> for InlineAsBox
where F: SerializeUnsized<S> + ?Sized, S: Fallible + ?Sized,

§

impl<F, S> SerializeWith<Cell<F>, S> for Unsafe
where F: Serialize<S>, S: Fallible + ?Sized,

§

impl<F, S> SerializeWith<UnsafeCell<F>, S> for Unsafe
where F: Serialize<S>, S: Fallible + ?Sized,

§

impl<F, S> SerializeWith<Mutex<F>, S> for Lock
where F: Serialize<S>, S: Fallible + ?Sized, <S as Fallible>::Error: Source,

§

impl<F, S> SerializeWith<RwLock<F>, S> for Lock
where F: Serialize<S>, S: Fallible + ?Sized, <S as Fallible>::Error: Source,

§

impl<F, S> SerializeWith<F, S> for AsBox
where F: SerializeUnsized<S> + ?Sized, S: Fallible + ?Sized,

§

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

§

impl<F, S> SerializeWith<F, S> for Skip
where S: Fallible + ?Sized,

§

impl<K, V, H, S> SerializeWith<HashMap<K, V, H>, S> for AsVec
where K: Serialize<S>, V: Serialize<S>, S: Fallible + Allocator + Writer + ?Sized,

§

impl<K, V, S> SerializeWith<BTreeMap<K, V>, S> for AsVec
where K: Serialize<S>, V: Serialize<S>, S: Fallible + Allocator + Writer + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<i8>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<i16>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<i32>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<i64>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<i128>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<isize>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<u8>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<u16>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<u32>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<u64>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<u128>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<Option<NonZero<usize>>, S> for Niche
where S: Fallible + ?Sized,

§

impl<S> SerializeWith<PathBuf, S> for AsString
where S: Fallible + ?Sized, <S as Fallible>::Error: Source, str: SerializeUnsized<S>,

§

impl<S> SerializeWith<OsString, S> for AsString
where S: Fallible + ?Sized, <S as Fallible>::Error: Source, str: SerializeUnsized<S>,

§

impl<S> SerializeWith<SystemTime, S> for AsUnixTime
where S: Fallible + ?Sized, <S as Fallible>::Error: Source,

§

impl<S, SO> SerializeWith<AtomicBool, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI8, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI16, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI32, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI64, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicIsize, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU8, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU16, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU32, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU64, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicUsize, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI16_be, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI16_le, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI32_be, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI32_le, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI64_be, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicI64_le, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU16_be, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU16_le, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU32_be, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU32_le, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU64_be, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, SO> SerializeWith<AtomicU64_le, S> for AtomicLoad<SO>
where S: Fallible + ?Sized, SO: LoadOrdering,

§

impl<S, const A: usize> SerializeWith<AlignedVec<A>, S> for AsVec
where S: Allocator + Fallible + Writer + ?Sized,

§

impl<T, H, S> SerializeWith<HashSet<T, H>, S> for AsVec
where T: Serialize<S>, S: Fallible + Allocator + Writer + ?Sized,

§

impl<T, N, S> SerializeWith<Option<T>, S> for NicheInto<N>
where T: Serialize<S>, N: Niching<<T as Archive>::Archived> + ?Sized, S: Fallible + ?Sized,

§

impl<T, S> SerializeWith<Option<Box<T>>, S> for Niche

§

impl<T, S> SerializeWith<Option<T>, S> for DefaultNiche

§

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

§

impl<T, S> SerializeWith<Rc<T>, S> for Unshare
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, S> SerializeWith<Arc<T>, S> for Unshare
where T: Serialize<S>, S: Fallible + ?Sized,

§

impl<T, W, N, S> SerializeWith<Option<T>, S> for MapNiche<W, N>
where W: SerializeWith<T, S> + ?Sized, N: Niching<<W as ArchiveWith<T>>::Archived> + ?Sized, S: Fallible + ?Sized,