Derive Macro bevy_serde_project_derive::SerdeProject
source · #[derive(SerdeProject)]
{
// Attributes available to this derive:
#[serde_project]
#[serde]
}
Expand description
Project a struct to and from a (de)serializable struct using World
access.
Requires all fields with SerdeProject
or Serialize
+ DeserializeOwned
implementations.
§Attributes
-
#[serde_project("TypeName")]
Convert to and from the target
SerdeProject
type viabevy_serde_project::Convert
. Commonly used to convert a foreign type to a newtype. -
#[serde_project(ignore)]
Ignore the field and default construct it if deserialized.
-
#[serde_project(rename = "new_name")]
Top level
#[serde(rename)]
is not allowed, this attribute replaces that functionality. -
#[serde(..)]
Copied to destination.
§Note
This macro currently does not support generics.