pub struct PageBundle { /* private fields */ }Expand description
A built page: files by URL path, and the path the browser opens.
Implementations§
Source§impl PageBundle
impl PageBundle
Sourcepub fn new(entry: &str, document: impl Into<Vec<u8>>) -> PageBundle
pub fn new(entry: &str, document: impl Into<Vec<u8>>) -> PageBundle
A bundle holding one document, served as HTML at entry.
Sourcepub fn with_file(self, path: &str, bytes: impl Into<Vec<u8>>) -> PageBundle
pub fn with_file(self, path: &str, bytes: impl Into<Vec<u8>>) -> PageBundle
Add a file, typed by its extension through the table largo serve uses.
Sourcepub fn with_head_markup(self, markup: &str) -> PageBundle
pub fn with_head_markup(self, markup: &str) -> PageBundle
The document with markup placed at the end of its head, as largo serve places a
project’s stylesheet links.
Sourcepub fn at(self, path: &str) -> PageBundle
pub fn at(self, path: &str) -> PageBundle
Serve the document at path instead, as a page declared at that path would be — and the
module and host beside it, where the document’s relative ./app.js and the host’s
./app.wasm resolve from that path.
Sourcepub fn page(source: &str) -> Result<PageBundle, String>
pub fn page(source: &str) -> Result<PageBundle, String>
A page as largo emit wasm-dom ships it: the module, the browser host, and the document
shell with nothing pre-rendered — the first paint is the module’s.
Sourcepub fn page_with(
source: &str,
entries: &HostEntries,
) -> Result<PageBundle, String>
pub fn page_with( source: &str, entries: &HostEntries, ) -> Result<PageBundle, String>
PageBundle::page for a host that also mounts entries’ components on demand: the
module exports each one’s mount, which runtime.js’s __logosMount calls. The document holds
no pre-rendered markup, so the module draws fresh and carries no hydration.
Sourcepub fn prerendered(source: &str) -> Result<PageBundle, String>
pub fn prerendered(source: &str) -> Result<PageBundle, String>
A page as largo build ships it: the same module and host, with the page’s markup already
in the document body, rendered by the build’s own pre-render, and served at the URL its
## Page declares, where the build puts it. A path with a :segment has no one URL to
serve, so that page stays at /.
Trait Implementations§
Source§impl Clone for PageBundle
impl Clone for PageBundle
Source§fn clone(&self) -> PageBundle
fn clone(&self) -> PageBundle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for PageBundle
impl RefUnwindSafe for PageBundle
impl Send for PageBundle
impl Sync for PageBundle
impl Unpin for PageBundle
impl UnsafeUnpin for PageBundle
impl UnwindSafe for PageBundle
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.