Skip to main content

Serialize

Trait Serialize 

Source
pub trait Serialize: Sync {
    // Required method
    fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>;

    // Provided methods
    fn finish(&self, _state: &mut State) -> Result<(), Error> { ... }
    fn is_optional(&self) -> bool { ... }
    fn describe(&self, d: &mut dyn Describe) { ... }
    fn container_shape(&self) -> ContainerShape { ... }
}
Expand description

A data structure that can be serialized into any data format supported by Deser.

serialize serializes the value into a Chunk. For compound values like lists or similar, the piece contains a boxed emitter which can be further processed to walk the embedded compound value. The container_shape of such values is passed on with the start event of the container.

§Thread Safety

Serializables are Sync and the emitters they create are Send. This allows an ongoing serialization (a SerializeDriver) to move between threads, for instance when it is suspended while the output is written asynchronously. Types with shared ownership or interior mutability that is not thread safe (such as Rc or RefCell) cannot be serialized. Mutex and RwLock cannot be serialized either as the lock guard would have to be held while the serialization moves between threads.

Required Methods§

Source

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Serializes this serializable.

Provided Methods§

Source

fn finish(&self, _state: &mut State) -> Result<(), Error>

Invoked after the serialization finished.

This is primarily useful to undo some state change in the serializer state at the end of the processing.

Source

fn is_optional(&self) -> bool

Checks if the current value that would be serialized represents an optional value.

This can be used by an emitter to skip over values that are currently in the optional state. For instance Option<T> returns true here if the value is None and the struct emitter created by the derive feature will skip over these if #[deser(skip_serializing_optionals)] is set on the struct.

Source

fn describe(&self, d: &mut dyn Describe)

Describes the Rust shape of this value.

This is only invoked by formats which want to reflect the Rust shape of values, see Describe. The default implementation describes nothing. Wrappers which serialize as the value they wrap should describe themselves and then delegate to the wrapped value.

Source

fn container_shape(&self) -> ContainerShape

Returns the shape of this value if it’s a map or sequence.

The shape is passed on with the MapStart or SeqStart event, it’s ignored for other values. The default is ContainerShape::new.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Serialize for ()

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn is_optional(&self) -> bool

Source§

impl Serialize for AtomicBool

Available on target_has_atomic=8 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicI8

Available on target_has_atomic=8 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicI16

Available on target_has_atomic=16 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicI32

Available on target_has_atomic=32 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicI64

Available on target_has_atomic=64 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicIsize

Available on target_has_atomic=ptr only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicU8

Available on target_has_atomic=8 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicU16

Available on target_has_atomic=16 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicU32

Available on target_has_atomic=32 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicU64

Available on target_has_atomic=64 only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for AtomicUsize

Available on target_has_atomic=ptr only.

The value is loaded with relaxed ordering.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for BStr

Available on crate feature bstr only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for BString

Available on crate feature bstr only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for BigDecimal

Available on crate feature bigdecimal only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for BigInt

Available on crate feature num-bigint only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for BigUint

Available on crate feature num-bigint only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Bytes

Available on crate feature bytes only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for BytesMut

Available on crate feature bytes only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for CStr

Serializes as bytes (without the nul terminator).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for CString

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Date

Available on crate feature jiff only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Date

Available on crate feature time only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for DateTime

Available on crate feature jiff only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for DateTime<FixedOffset>

Available on crate feature chrono only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for DateTime<Utc>

Available on crate feature chrono only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Decimal

Available on crate feature rust_decimal only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Duration

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Duration

Available on crate feature time only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Infallible

Values of Infallible do not exist, they are never serialized.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for IpAddr

Serializes as a string (with Display).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Ipv4Addr

Serializes as a string (with Display).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Ipv6Addr

Serializes as a string (with Display).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NaiveDate

Available on crate feature chrono only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NaiveDateTime

Available on crate feature chrono only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NaiveTime

Available on crate feature chrono only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<i8>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<i16>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<i32>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<i64>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<i128>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<isize>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<u8>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<u16>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<u32>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<u64>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<u128>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for NonZero<usize>

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for OffsetDateTime

Available on crate feature time only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for OsStr

Available on crate feature std only.

Serializes as a string like Path. OS strings which are not valid UTF-8 fail to serialize.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for OsString

Available on crate feature std only.
Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Path

Available on crate feature std only.

Serializes as a string. Paths which are not valid UTF-8 fail to serialize.

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for PathBuf

Available on crate feature std only.
Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for PrimitiveDateTime

Available on crate feature time only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for SignedDuration

Available on crate feature jiff only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for SocketAddr

Serializes as a string (with Display).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for SocketAddrV4

Serializes as a string (with Display).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for SocketAddrV6

Serializes as a string (with Display).

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for String

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for SystemTime

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Time

Available on crate feature jiff only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Time

Available on crate feature time only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for TimeDelta

Available on crate feature chrono only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Timestamp

Available on crate feature jiff only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for UtcDateTime

Available on crate feature time only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Uuid

Available on crate feature uuid only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for Zoned

Available on crate feature jiff only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for bool

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for char

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for f32

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for f64

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for i8

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for i16

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for i32

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for i64

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for i128

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for isize

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for str

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for u8

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for u16

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for u32

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for u64

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for u128

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl Serialize for usize

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<'a, T: Serialize + ?Sized> Serialize for &'a T

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<'a, T: Serialize + ?Sized> Serialize for &'a mut T

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<'a, T: Serialize + ?Sized> Serialize for Box<T>

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<'a, T: Serialize + Clone> Serialize for Cow<'a, [T]>

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<'a, T: Serialize + Send + ?Sized> Serialize for Arc<T>

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<'a, T: Serialize> Serialize for &'a [T]

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<'a, T> Serialize for Cow<'a, T>
where T: Serialize + ToOwned + ?Sized, T::Owned: Sync,

Cow<[T]> is implemented separately as slices are serialized by the containers holding them (see serialize_slice).

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<K, V, H: BuildHasher + Sync> Serialize for HashMap<K, V, H>
where K: Serialize, V: Serialize,

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<K, V, S: Sync> Serialize for HashMap<K, V, S>
where K: Serialize, V: Serialize,

Available on crate feature hashbrown only.
Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<K, V, S: Sync> Serialize for IndexMap<K, V, S>
where K: Serialize, V: Serialize,

Available on crate feature indexmap only.
Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<K, V> Serialize for BTreeMap<K, V>
where K: Serialize, V: Serialize,

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T1: Serialize, T2: Serialize, T3: Serialize, T4: Serialize, T5: Serialize, T6: Serialize, T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T2: Serialize, T3: Serialize, T4: Serialize, T5: Serialize, T6: Serialize, T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T3: Serialize, T4: Serialize, T5: Serialize, T6: Serialize, T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T4: Serialize, T5: Serialize, T6: Serialize, T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T5: Serialize, T6: Serialize, T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T6: Serialize, T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T6, T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T7: Serialize, T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T7, T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T8: Serialize, T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T8, T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T9: Serialize, T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T9, T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T10: Serialize, T11: Serialize, T12: Serialize> Serialize for (T10, T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T11: Serialize, T12: Serialize> Serialize for (T11, T12)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T12: Serialize> Serialize for (T12,)

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T, H: BuildHasher + Sync> Serialize for HashSet<T, H>
where T: Serialize,

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T, S: Sync> Serialize for HashSet<T, S>
where T: Serialize,

Available on crate feature hashbrown only.
Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T, S: Sync> Serialize for IndexSet<T, S>
where T: Serialize,

Available on crate feature indexmap only.
Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: ?Sized + Sync> Serialize for PhantomData<T>

Serializes as null like ().

Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn is_optional(&self) -> bool

Source§

impl<T: Serialize + Send> Serialize for Arc<[T]>

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize + Send> Serialize for OnceLock<T>

Available on crate feature std only.

Serializes like an Option: as the value if it’s set, as null if not.

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<T: Serialize, E: Serialize> Serialize for Result<T, E>

Serializes externally tagged: {"Ok": value} or {"Err": error}.

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize, const CAP: usize> Serialize for ArrayVec<T, CAP>

Available on crate feature arrayvec only.
Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize, const N: usize> Serialize for SmallVec<[T; N]>

Available on crate feature smallvec only.
Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize, const N: usize> Serialize for [T; N]

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for BinaryHeap<T>

The elements are emitted in the (arbitrary) order of the heap.

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for Bound<T>

Serializes externally tagged like serde: "Unbounded", {"Included": value} or {"Excluded": value}.

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for Box<[T]>

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for LinkedList<T>

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for ManuallyDrop<T>

Serializes as the inner value.

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<T: Serialize> Serialize for Range<T>

Serializes as a struct with start and end like serde.

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for RangeFrom<T>

Serializes as a struct with start like serde.

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for RangeInclusive<T>

Serializes as a struct with start and end like serde.

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for RangeTo<T>

Serializes as a struct with end like serde.

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for Reverse<T>

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<T: Serialize> Serialize for Saturating<T>

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<T: Serialize> Serialize for Vec<T>

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for VecDeque<T>

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T: Serialize> Serialize for Wrapping<T>

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

impl<T> Serialize for BTreeSet<T>
where T: Serialize,

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

impl<T> Serialize for Option<T>
where T: Serialize,

Source§

fn is_optional(&self) -> bool

Source§

fn container_shape(&self) -> ContainerShape

Source§

fn describe(&self, d: &mut dyn Describe)

Source§

fn serialize(&self, state: &mut State) -> Result<Chunk<'_>, Error>

Source§

fn finish(&self, state: &mut State) -> Result<(), Error>

Source§

impl<const CAP: usize> Serialize for ArrayString<CAP>

Available on crate feature arrayvec only.
Source§

fn serialize(&self, _state: &mut State) -> Result<Chunk<'_>, Error>

Implementors§

Source§

impl Serialize for deser_core::ext::BigInt

Source§

impl Serialize for Datetime

Source§

impl Serialize for deser_core::ext::Decimal

Source§

impl Serialize for deser_core::ext::Duration

Source§

impl Serialize for RecordBuf<'_>

Record buffers serialize like Recordings, borrowed atoms are serialized without copying them.

Source§

impl Serialize for Recording

Source§

impl Serialize for deser_core::ext::Timestamp

Source§

impl Serialize for deser_core::ext::Uuid

Source§

impl<'a> Serialize for Number<'a>

Source§

impl<T: Serialize> Serialize for Streamed<T>

Source§

impl<T: Sync, A: SerializeAs<T>> Serialize for As<T, A>