pub struct ImmutableStore { /* private fields */ }
Expand description

An immutable storage system used by Perseus’ engine to store build artifacts and the like, which will then be used by the server or the export process. By default, this is set to a path inside the dist/ folder at the root of your project, which you should only change if you have special requirements, as the CLI expects the default paths to be used, with no option for customization yet.

Note that this is only used for immutable data, which can be read-only in production, meaning there are no consequences of using this on a read-only production filesystem (e.g. in a serverless function). Data that do need to change use a MutableStore instead.

Implementations§

Creates a new immutable store. You should provide a path like dist here. Note that any trailing slashes will be automatically stripped.

Gets the filesystem path used for this immutable store.

This is designed to be used in particular by the engine to work out where to put static assets and the like when exporting.

Reads the given asset from the filesystem asynchronously.

Writes the given asset to the filesystem asynchronously. This must only be used at build-time, and must not be changed afterward. Note that this will automatically create any missing parent directories.

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

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
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.