pub trait Prefab: Serialize + DeserializeOwned {
// Provided methods
fn from_prefab(data: Value) -> Result<Self, PrefabError> { ... }
fn to_prefab(&self) -> Result<Value, PrefabError> { ... }
}
Expand description
The Prefab
trait is implemented for types that are able to translate to and from
PrefabValue
’s
PrefabValue
’s can then, in turn, be serialized or deserialized for persistance, transfer, or
other purposes.
Provided Methods§
fn from_prefab(data: Value) -> Result<Self, PrefabError>
fn to_prefab(&self) -> Result<Value, PrefabError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.