pub enum SerializeHandle<'a> {
    Borrowed(&'a dyn Serialize),
    Owned(Box<dyn Serialize + 'a>),
}
Expand description

A handle to a Serialize type.

During serialization it common to be in a situation where one needs to return locally constructed Serialize. This is where SerializeHandle comes in. In cases where the Serialize cannot be borrowed it can be boxed up inside the handle.

The equivalent for deserialization is the SinkHandle.

Variants

Borrowed(&'a dyn Serialize)

A borrowed reference to a Serialize.

Owned(Box<dyn Serialize + 'a>)

A boxed up Serialize.

Implementations

Create a borrowed handle to a Serialize.

Create an owned handle to a heap allocated Serialize.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.