Trait fj_kernel::partial::HasPartial
source · 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
Provided Methods
sourcefn partial() -> Self::Partial
fn partial() -> Self::Partial
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.
sourcefn to_partial(&self) -> Self::Partial
fn to_partial(&self) -> Self::Partial
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.