pub trait HasPartial {
    type Partial: Partial<Full = Self>;

    fn partial() -> Self::Partial { ... }
    fn to_partial(&self) -> Self::Partial { ... }
}
Expand description

Implemented for objects that a partial object type exists for

Implementation Note

This trait is usually implemented for object types themselves, but types that are already managed in the centralized object storage (#1021) implement this trait for Handle<T> instead. This is necessary, due to the use of this type in MaybePartial, but leads to some not so nice inconsistencies.

Once #1021 is addressed and all types are managed in the centralized object storage, this should be changed to all object types implement this directly.

Required Associated Types

The type representing the partial variant of this object

Provided Methods

Create an empty partial variant of this object

This function exists just for convenience, and will just return a Default version of the partial object.

Convert this object into its partial variant

All fields of the partial variant are set from this object. This is useful when creating a new object that needs to share parts of an existing one.

Implementors