Struct perseus::stores::immutable::ImmutableStore
source · 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§
source§impl ImmutableStore
impl ImmutableStore
sourcepub fn new(root_path: String) -> Self
pub fn new(root_path: String) -> Self
Creates a new immutable store. You should provide a path like dist
here. Note that any trailing slashes will be automatically stripped.
sourcepub fn get_path(&self) -> &str
pub fn get_path(&self) -> &str
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.
Trait Implementations§
source§impl Clone for ImmutableStore
impl Clone for ImmutableStore
source§fn clone(&self) -> ImmutableStore
fn clone(&self) -> ImmutableStore
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more