pub enum ClientAssets {
Embedded(&'static [EmbeddedFile]),
Disk(PathBuf),
}Expand description
The client the browser downloads, from whichever source this process was given. Two sources, one contract: the release binary carries the bundle inside itself; a development loop points at the directory the wasm build writes, read per request so an edit shows on refresh.
Variants§
Embedded(&'static [EmbeddedFile])
The bundle inside the binary, one gzip per file.
Disk(PathBuf)
A directory on disk, read per request. Loopback development only; the release path never constructs this arm.
Implementations§
Source§impl ClientAssets
impl ClientAssets
Sourcepub fn lookup(&self, request_path: &str) -> AssetReply
pub fn lookup(&self, request_path: &str) -> AssetReply
Answers one request path. Pure over the embedded arm; the disk arm reads exactly the file the sanitised path names.
"" and "/" mean index.html. A path that steps outside the
bundle (.., empty segments, drive letters, leading dots) is a
miss, not an error: the bundle is the whole world this route knows.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClientAssets
impl RefUnwindSafe for ClientAssets
impl Send for ClientAssets
impl Sync for ClientAssets
impl Unpin for ClientAssets
impl UnsafeUnpin for ClientAssets
impl UnwindSafe for ClientAssets
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