Trait xylem::ArcSchemaExt[][src]

pub trait ArcSchemaExt: Schema { }
Expand description

Implement this trait for a schema type to support standard Arc conversion.

This allows Arc<T> to be converted from Arc<T::From>, basically making the Arc wrapper transparent. The argument type is passed as-is.

Choice of the From associated type

The choice of Box instead of Arc in the From type considers the design goal where the From type is typically produced from deserialization directly, where the Arc wrapper is just a Box with some more overhead, where the underlying type cannot be moved out without a panic branch, in which case a Box would have just been more reasonable.

The reason for using Box<T> instead of T considers the possibility where T is a recursive type.

Implementors