[−][src]Struct webbundle::Builder
A Bundle builder.
Methods
impl Builder
[src]
pub fn version(self, version: Version) -> Self
[src]
Sets the version.
pub fn primary_url(self, primary_url: Uri) -> Self
[src]
Sets the primary url.
pub fn manifest(self, manifest: Uri) -> Self
[src]
Sets the manifest url.
pub fn exchange(self, exchange: Exchange) -> Self
[src]
Adds the exchange.
pub async fn exchanges_from_dir(
__arg0: Self,
dir: impl AsRef<Path>,
base_url: Url
) -> Result<Self>
[src]
__arg0: Self,
dir: impl AsRef<Path>,
base_url: Url
) -> Result<Self>
Append exchanges from files rooted at the given directory.
base_url
will be used as a prefix for each resource. A relative path
from the given directory to each file is appended to base_url
.
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.html
file. - The URL for
index.html
file is a redirect to the parent directory (301
MOVED PERMANENTLY).
Examples
use webbundle::{Bundle, Version}; let bundle = Bundle::builder() .version(Version::VersionB1) .primary_url("https://example.com/".parse()?) .exchanges_from_dir("build", "https://example.com".parse()?).await? .build()?;
pub fn build(self) -> Result<Bundle>
[src]
Builds the bundle.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,