pub enum SpaSource {
Disk(String),
Embedded {
assets: EmbeddedAssets,
overlay_root: String,
},
}Expand description
Where a SpaMiddleware takes its files from.
Built by Host::builder(): use_spa(...) names the disk directory;
a registered embed_assets!() table is layered underneath at build time.
Variants§
Disk(String)
A directory, resolved the same way as config::load_appsettings does.
Embedded
Files compiled into the executable, served for any name that is not
present under overlay_root.
Fields
§
assets: EmbeddedAssetsThe compiled-in baseline.
Implementations§
Source§impl SpaSource
impl SpaSource
Sourcepub fn embedded(&self) -> Option<&EmbeddedAssets>
pub fn embedded(&self) -> Option<&EmbeddedAssets>
The embedded baseline, if this source has one.
Sourcepub fn with_overlay_root(self, dir: impl Into<String>) -> SpaSource
pub fn with_overlay_root(self, dir: impl Into<String>) -> SpaSource
Use dir on disk, replacing whatever root was configured before.
This is how use_spa("wwwroot") states where operators may drop
overrides, independently of the directory the assets were compiled from.
Trait Implementations§
Source§impl From<EmbeddedAssets> for SpaSource
impl From<EmbeddedAssets> for SpaSource
Source§fn from(assets: EmbeddedAssets) -> SpaSource
fn from(assets: EmbeddedAssets) -> SpaSource
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SpaSource
impl RefUnwindSafe for SpaSource
impl Send for SpaSource
impl Sync for SpaSource
impl Unpin for SpaSource
impl UnsafeUnpin for SpaSource
impl UnwindSafe for SpaSource
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