Struct quad_wasmnastics::storage::Location[][src]

pub struct Location {
    pub bin_name: String,
    pub version: String,
    pub profile: String,
}
Expand description

Settings for where the data should be stored.

  • On desktop, data is stored to /path/to/datadir/{bin_name}/v{version}/{profile}.dat.
  • On localstorage, data is stored under the key "{bin_name}/v{version}/{profile}".

Fields

bin_name: String

The name of your binary crate, via env!("CARGO_PKG_NAME").

You probably don’t want to edit this, but you might if you want several of your games to talk to each other, for example. (Note this example probably won’t be portable on the web because localstorage only stores things to one origin. If you host all your games yourself on one domain it might be, but on itch.io for example it won’t be.)

version: String

The version of your binary crate, via env!("CARGO_PKG_VERSION").

You might want to edit this if your serialization format updates less often than your crate version.

profile: String

The profile name.

If you have multiple players, you definitely want to update this.

Is "default" by default.

Implementations

Get the path to save the data to.

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

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

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)

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.