pub struct Builder { /* private fields */ }Expand description
A Bundle builder.
Implementations§
Source§impl Builder
impl Builder
Sourcepub async fn exchanges_from_dir(self, dir: impl AsRef<Path>) -> Result<Self>
pub async fn exchanges_from_dir(self, dir: impl AsRef<Path>) -> Result<Self>
Append exchanges from files rooted at the given directory.
One exchange is created for each file, however, two exchanges
are created for index.html file, as follows:
- The pareent directory serves the contents of
index.htmlfile. - The URL for
index.htmlfile is a redirect to the parent directory (301MOVED PERMANENTLY).
§Examples
use webbundle::{Bundle, Version};
let bundle = Bundle::builder()
.version(Version::VersionB2)
.exchanges_from_dir("build").await?
.build()?;Sourcepub fn exchanges_from_dir_sync(self, dir: impl AsRef<Path>) -> Result<Self>
pub fn exchanges_from_dir_sync(self, dir: impl AsRef<Path>) -> Result<Self>
Sync version of exchanges_from_dir.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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