Skip to main content

SerializeWith

Trait SerializeWith 

Source
pub trait SerializeWith<F: ?Sized, S: Fallible + ?Sized>: ArchiveWith<F> {
    // Required method
    fn serialize_with(
        field: &F,
        serializer: &mut S,
    ) -> Result<Self::Resolver, S::Error>;
}
Expand description

A variant of Serialize for “with” types.

See ArchiveWith for more details.

Required Methods§

Source

fn serialize_with( field: &F, serializer: &mut S, ) -> Result<Self::Resolver, S::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".

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

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::Error: Source, H: Default + BuildHasher, H::Hasher: Default,

Source§

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::Error: Source,

Source§

impl<A, O, S, const N: usize> SerializeWith<[O; N], S> for Map<A>
where S: Fallible + ?Sized, A: ArchiveWith<O> + SerializeWith<O, S>,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<S> SerializeWith<&str, S> for AsString

Source§

impl<S> SerializeWith<OsString, S> for AsString

Source§

impl<S> SerializeWith<PathBuf, S> for AsString

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Available on target_has_atomic=ptr only.
Source§

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

Source§

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

Source§

impl<T, S> SerializeWith<Option<T>, S> for DefaultNiche
where T: Serialize<S>, Self: Niching<T::Archived>, S: Fallible + ?Sized,

Source§

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,

Source§

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