Struct savefile::Canary1[][src]

pub struct Canary1 {}
Expand description

Useful zero-sized marker. It serializes to a magic value, and verifies this value on deserialization. Does not consume memory data structure. Useful to troubleshoot broken Serialize/Deserialize implementations.

Implementations

Create a new Canary1 object. Object has no contents.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize and return an instance of Self from the given deserializer.

Returns the value of the object, excluding children, as a string. Exactly what the value returned here is depends on the type. For some types, like a plain array, there isn’t much of a value, the entire information of object resides in the children. For other cases, like a department in an organisation, it might make sense to have the value be the name, and have all the other properties as children. Read more

Returns an the name and &dyn Introspect for the child with the given index, or if no child with that index exists, None. All the children should be indexed consecutively starting at 0 with no gaps, all though there isn’t really anything stopping the user of the trait to have any arbitrary index strategy, consecutive numbering 0, 1, 2, … etc is strongly encouraged. Read more

Returns the total number of children. The default implementation calculates this by simply calling introspect_child with higher and higher indexes until it returns None. It gives up if the count reaches 10000. If your type can be bigger and you want to be able to introspect it, override this method. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize self into the given serializer.

Returns a representation of the schema used by this Serialize implementation for the given version.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.