Struct savefile::SchemaEnum
source · pub struct SchemaEnum {
pub dbg_name: String,
pub variants: Vec<Variant>,
}
Expand description
An enum is serialized as its u8 variant discriminator followed by all the field for that variant. The name of each variant, as well as its order in the enum (the discriminator), is significant.
Fields§
§dbg_name: String
Diagnostic name
variants: Vec<Variant>
Variants of enum
Trait Implementations§
source§impl Debug for SchemaEnum
impl Debug for SchemaEnum
source§impl Deserialize for SchemaEnum
impl Deserialize for SchemaEnum
source§fn deserialize(
deserializer: &mut Deserializer<'_, impl Read>
) -> Result<Self, SavefileError>
fn deserialize( deserializer: &mut Deserializer<'_, impl Read> ) -> Result<Self, SavefileError>
Deserialize and return an instance of Self from the given deserializer.
source§impl PartialEq for SchemaEnum
impl PartialEq for SchemaEnum
source§fn eq(&self, other: &SchemaEnum) -> bool
fn eq(&self, other: &SchemaEnum) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ReprC for SchemaEnum
impl ReprC for SchemaEnum
source§unsafe fn repr_c_optimization_safe(_version: u32) -> IsReprC
unsafe fn repr_c_optimization_safe(_version: u32) -> IsReprC
This method returns true if the optimization is allowed
for the protocol version given as an argument.
This may return true if and only if the given protocol version
has a serialized format identical to the given protocol version. Read more
source§impl Serialize for SchemaEnum
impl Serialize for SchemaEnum
source§fn serialize(
&self,
serializer: &mut Serializer<'_, impl Write>
) -> Result<(), SavefileError>
fn serialize( &self, serializer: &mut Serializer<'_, impl Write> ) -> Result<(), SavefileError>
Serialize self into the given serializer.
In versions prior to 0.15, ‘Serializer’ did not accept a type parameter.
It now requires a type parameter with the type of writer expected.
source§impl WithSchema for SchemaEnum
impl WithSchema for SchemaEnum
impl StructuralPartialEq for SchemaEnum
Auto Trait Implementations§
impl RefUnwindSafe for SchemaEnum
impl Send for SchemaEnum
impl Sync for SchemaEnum
impl Unpin for SchemaEnum
impl UnwindSafe for SchemaEnum
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more